Ethan Furman added the comment:
Sorry, no. And time is scarce at the moment so figuring out server-side clones
will have to wait as well.
I uploaded the patch of what I have so far -- hopefully that will be helpful.
Also attaching patch with just the tests.
--
Added file:
http
Ethan Furman added the comment:
Apologies, my wording was poor -- the last item evaluated is the one returned,
but all items may not be evaluated. As soon as the answer is known Python
stops evaluating any remaining items.
So in the example:
-- string1, string2, string3 = '', 'Trondheim
Ethan Furman added the comment:
`or` does not return the last item evaluated -- it returns the first truthy
item, or, if no truthy items, the last false item:
-- 0 or {}
{}
-- 0 or 1 or {}
1
--
nosy: +ethan.furman
___
Python tracker rep
Ethan Furman added the comment:
Raymond Hettinger added the comment:
---
This bug report isn't a JSON spec issue; rather, it is about how the JSON
module API can
support (or inhibit) valid use cases.
AFAICT, the patch to make the API better support enums
Ethan Furman added the comment:
Enums (and other numeric subclasses), do not round-trip back to themselves. An
IntEnum with the value of 4 is written as 4 and converted back from json as the
integer 4 (not Settings.TabSpaces, or whatever).
Given that json is multi-language format
Changes by Ethan Furman et...@stoneleaf.us:
--
nosy: +belopolsky, ethan.furman, lemburg
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23084
Ethan Furman added the comment:
I haven't reviewed the patch yet, but I believe the intent is not for better
sleep support, but simply to be able to create and record time data which
contains nano-seconds.
python-dev discussion here:
https://mail.python.org/pipermail/python-dev/2014
Ethan Furman added the comment:
Just keep the word nanasecond in there somewhere, as that is the motivating
purpose behind the patch.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23084
Ethan Furman added the comment:
If I am reading data from an external device that has nanosecond resolution,
how would I create such a time stamp in Python right now?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23084
Ethan Furman added the comment:
Please do! Working examples are better than non-working ones. :)
--
nosy: +ethan.furman
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23073
Ethan Furman added the comment:
While you're at it, could you also sign the contributors' license agreement?
https://www.python.org/psf/contrib/contrib-form/
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23073
Ethan Furman added the comment:
No worries, thanks for following up.
--
resolution: - not a bug
stage: - resolved
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23073
Changes by Ethan Furman et...@stoneleaf.us:
--
nosy: +ethan.furman
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23030
___
___
Python-bugs-list
Changes by Ethan Furman et...@stoneleaf.us:
--
nosy: +ncoghlan, rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23030
___
___
Python-bugs
Changes by Ethan Furman et...@stoneleaf.us:
--
nosy: +ethan.furman
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15443
___
___
Python-bugs-list
Ethan Furman added the comment:
When reading this thread, keep in mind that most of it was taken up with
rejecting exposing the underlying data structure, which is not what this patch
does.
https://mail.python.org/pipermail/python-ideas/2014-December/030230.html
Changes by Ethan Furman et...@stoneleaf.us:
--
nosy: +ethan.furman
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9536
___
___
Python-bugs-list
Changes by Ethan Furman et...@stoneleaf.us:
--
nosy: +ethan.furman
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23006
___
___
Python-bugs-list
Ethan Furman added the comment:
Superseded by PEP467.
--
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20895
___
___
Python
Changes by Ethan Furman et...@stoneleaf.us:
--
nosy: +ethan.furman
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23001
___
___
Python-bugs-list
Changes by Ethan Furman et...@stoneleaf.us:
--
nosy: +ethan.furman
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22997
___
___
Python-bugs-list
Ethan Furman added the comment:
Simeon, the patch looks decent; I'll review it more carefully later.
If you are going to contribute non-trivial patches, you'll need to sign the
CLA: https://www.python.org/psf/contrib/contrib-form/ .
Thanks for helping
Changes by Ethan Furman et...@stoneleaf.us:
--
nosy: +ethan.furman, giampaolo.rodola, gvanrossum, haypo, pitrou, yselivanov
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22988
Ethan Furman added the comment:
Here's the excerpt from the docs:
Yield expressions are allowed in the try clause of a try ... finally
construct.
If the generator is not resumed before it is finalized (by reaching a zero
reference
count or by being garbage
Changes by Ethan Furman et...@stoneleaf.us:
--
nosy: +ethan.furman
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22986
___
___
Python-bugs-list
Ethan Furman added the comment:
Fix `self` now, add a warning and single minor cycle deprecation period for
'dict'.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22609
Changes by Ethan Furman et...@stoneleaf.us:
--
nosy: +ethan.furman
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22951
___
___
Python-bugs-list
Ethan Furman added the comment:
Thank you, Berker.
--
resolution: - fixed
stage: patch review - resolved
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22780
Ethan Furman added the comment:
Here's the latest patch. Thoughts?
--
keywords: +patch
stage: resolved - patch review
Added file: http://bugs.python.org/file37254/issue22780.stoneleaf.01.patch
___
Python tracker rep...@bugs.python.org
http
Ethan Furman added the comment:
Thoughts?
--
keywords: +patch
stage: - patch review
versions: +Python 3.5
Added file: http://bugs.python.org/file37255/issue20467.stoneleaf.01.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org
Changes by Ethan Furman et...@stoneleaf.us:
--
nosy: +ethan.furman
resolution: - duplicate
status: open - closed
superseder: - deeply nested filter segfaults
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22920
Ethan Furman added the comment:
From Terry Reedy in issue22920:
--
Ian Kelly (python-list, version unspecified) got Segmentation fault (core
dumped). With 2.7, 3.4.2, 3.5, I get same in interactive interpreter, the
Windows python has stopped working box from
Changes by Ethan Furman et...@stoneleaf.us:
--
nosy: +ethan.furman
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22903
___
___
Python-bugs-list
Changes by Ethan Furman et...@stoneleaf.us:
--
nosy: +ethan.furman
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22894
___
___
Python-bugs-list
Ethan Furman added the comment:
From a post by Ian Kelly
(https://mail.python.org/pipermail/python-list/2014-November/681073.html)
--
In fact it seems the behavior does differ between Python 2.7 and Python 3.4:
$ cat testatexit.py
Changes by Ethan Furman et...@stoneleaf.us:
--
nosy: +belopolsky, ethan.furman, lemburg
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22871
Changes by Ethan Furman et...@stoneleaf.us:
--
nosy: +ethan.furman, jnoller, sbt
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22872
Changes by Ethan Furman et...@stoneleaf.us:
--
nosy: +ethan.furman
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22873
___
___
Python-bugs-list
Changes by Ethan Furman et...@stoneleaf.us:
--
nosy: +ethan.furman
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22867
___
___
Python-bugs-list
Ethan Furman added the comment:
What result did you expect?
--
nosy: +ethan.furman
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22840
Ethan Furman added the comment:
The documentation certainly appears to say that %m, for example, will consume
two digits, but it could just as easily be only for output (i.e. strftime).
I suspect this is simply a documentation issue as opposed to a bug, but let's
see what the others think
Ethan Furman added the comment:
No real-world use-cases have surfaced. Many thanks to everyone's explanations
and examples.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22766
Changes by Ethan Furman et...@stoneleaf.us:
--
nosy: +ethan.furman
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9951
___
___
Python-bugs-list
Changes by Ethan Furman et...@stoneleaf.us:
--
nosy: +ethan.furman
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17900
___
___
Python-bugs-list
Changes by Ethan Furman et...@stoneleaf.us:
--
nosy: +ethan.furman
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22806
___
___
Python-bugs-list
Ethan Furman added the comment:
Raymond declared:
Let's be clear. These are duck-typed methods. A type check is inappropriate.
Anything with o.items() is allowed regardless of type.
Wikipedia explains (http://en.wikipedia.org/wiki/Duck_typing
Ethan Furman added the comment:
I've posted to python-list and python-dev. I'll report back here the findings,
if any.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22766
New submission from Ethan Furman:
test script:
---
from collections import Counter
empty_counter = Counter()
counter = Counter('abbc')
empty_counter = 5
counter = 5
---
results
Changes by Ethan Furman et...@stoneleaf.us:
Removed file: http://bugs.python.org/file37136/issue22778.stoneleaf.01.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22801
Changes by Ethan Furman et...@stoneleaf.us:
Added file: http://bugs.python.org/file37137/issue22778.stoneleaf.01.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22801
Ethan Furman added the comment:
R. David Murray said:
try the reflected operation is not our standard terminology.
Parenthetical under discussion:
---
(The interpreter will then try the reflected operation, or some other
fallback,
depending
Ethan Furman added the comment:
Why are __flags__, __basicsize__, __itemsize__, __dictoffset__, and
__weakrefoffset__ interesting?
I agree with Georg about the others.
--
nosy: +ethan.furman
___
Python tracker rep...@bugs.python.org
http
Ethan Furman added the comment:
Whew!
If a different wording is better, I'm happy to change both places. :)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22780
Ethan Furman added the comment:
I don't want to change the kind of exception being raised (an API change from
AttributeError to TypeError) without a really good reason.
Subclasses cannot work with the current implementation.
In general, in-place methods are not required to return
Ethan Furman added the comment:
Ethan stated:
The only problem with the design is that it does not play well with others.
For
duck-typeable just do a check on 'other' to see if it has an .items()
method, and
return NotImplemented if it does not. Oh, and check that 'self' is Counter
Ethan Furman added the comment:
Okay, the python-dev ruling is in, and raising an exception in the __ixxx__
methods is allowed, and even a good idea in the cases of mutable containers.
However, doing the check on 'other' and raising a TypeError with an appropriate
message would still
Ethan Furman added the comment:
+ Special value which should be returned by the special methods
+ (:meth:`__eq__`, :meth:`__lt__`, :meth:`__add__`, etc.) to indicate
+ that the operation is not implemented with respect to the other type.
After a discussion on python-dev, I think
Ethan Furman added the comment:
I found these items:
Doc/c-api/object.rst
.. c:var:: PyObject* Py_NotImplemented
The ``NotImplemented`` singleton, used to signal that an operation is
not implemented for the given type combination.
Doc/extending/newtypes.rst
Ethan Furman added the comment:
Thank you, Raymond, both for your concern and your discretion.
My interest in changing the can or may to should is that, whatever the
original intent of the PEP, the way Python works /now/ is that any class that
doesn't return NotImplemented when it /should
Ethan Furman added the comment:
How about:
Special value which should be returned by the binary special methods
(e.g. :meth:`__eq__`, :meth:`__lt__`, :meth:`__add__`, :meth:`__rsub__`,
etc.) to indicate that the operation is not implemented with respect to
the other type; may
Ethan Furman added the comment:
Here's the actual change:
+ Special value which should be returned by the special methods
+ (:meth:`__eq__`, :meth:`__lt__`, :meth:`__add__`, etc.) to indicate
+ that the operation is not implemented with respect to the other type.
I'll update the Enum
Ethan Furman added the comment:
Closing this as a duplicate of issue19404.
--
resolution: - duplicate
status: open - closed
superseder: - Simplify per-instance control of help() output
___
Python tracker rep...@bugs.python.org
http
Ethan Furman added the comment:
Michael Foord opined:
-
Maybe discovery should special case that class and not treat it as a normal
TestCase.
Not a bad idea. On the other hand, I don't believe unittest is advertised as
supporting 'from ... import *', which *is* usually
New submission from Ethan Furman:
-- s = []
-- s += 1
Traceback (most recent call last):
File stdin, line 1, in module
TypeError: 'int' object is not iterable
For comparison, when NotImplemented is appropriately returned the message looks
like this:
-- s -= 1
Traceback (most recent call
Ethan Furman added the comment:
The behavior exhibited by set() is correct, and the behavior for array and
bytearray are fine, as the error message is even more helpful.
Issues opened for list (issue22778) and deque (issue22779).
--
___
Python
New submission from Ethan Furman:
-- from collections import deque
-- d = deque()
-- d += 1
Traceback (most recent call last):
File stdin, line 1, in module
TypeError: 'int' object is not iterable
deque should be returning NotImplemented, which would generate a more
appropriate error message
Ethan Furman added the comment:
https://docs.python.org/2/reference/datamodel.html#object.__iadd__
--
[...] These methods should attempt to do the operation in-place (modifying
self) and return the result (which could be, but does
Ethan Furman added the comment:
My understanding was that if a different patch will be needed, it is not the
same issue. Is that not correct?
Here's the test:
def test_iadd(self):
...
self.assertRaises(TypeError, u.__iadd__, None)
It would still pass, as returning
Ethan Furman added the comment:
Nevertheless, that is the behavior if NotImplemented is returned by a method.
Here's some code to demonstrate:
--8---
from collections import Counter
class Spam(int):
for sake of example
def __radd__(self, other
New submission from Ethan Furman:
https://docs.python.org/3/library/constants.html
current
---
Special value which can be returned by the “rich comparison” special
methods (__eq__(), __lt__(), and friends), to indicate that the comparison is
not implemented with respect to the other
Changes by Ethan Furman et...@stoneleaf.us:
--
stage: needs patch - resolved
status: open - closed
versions: +Python 3.5
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22780
Changes by Ethan Furman et...@stoneleaf.us:
--
assignee: - rhettinger
nosy: +ethan.furman, rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22766
Changes by Ethan Furman et...@stoneleaf.us:
--
versions: +Python 2.7, Python 3.5
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22766
Ethan Furman added the comment:
As I noted in my review, the docstring specifically says other Counter.
If we want to relax that we could check for an 'items' attribute and 'return
NotImplemented' if it isn't there, but one or the other should definitely
happen
Ethan Furman added the comment:
Indeed -- we mostly discuss with each other to try and sway his opinion. :)
stdlib types should not let every error bubble up. Consider a dict:
-- d = {}
-- d += 2
Traceback (most recent call last
Ethan Furman added the comment:
I do not think 'next' is needed in this context. Unlike 'match' and 'search',
'next' is a function that can be used with any iterator and mentioning it here
is unnecessary.
--
___
Python tracker rep
Changes by Ethan Furman et...@stoneleaf.us:
--
nosy: +ethan.furman
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22738
___
___
Python-bugs-list
Changes by Ethan Furman et...@stoneleaf.us:
--
nosy: +ethan.furman
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22741
___
___
Python-bugs-list
Ethan Furman added the comment:
rdm was not asking for an argument, he was asking for a more detailed
explanation of what was confusing. Your initial response lacked courtesy and
respect, and is not appreciated.
The rest of your reply was much better. Next time, please skip the
non
Ethan Furman added the comment:
+1 for rdm's change.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22725
___
___
Python-bugs-list mailing list
Changes by Ethan Furman et...@stoneleaf.us:
--
nosy: +ethan.furman
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22698
___
___
Python-bugs-list
Ethan Furman added the comment:
Thanks for the reminder!
...
Done.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22506
___
___
Python-bugs
Ethan Furman added the comment:
1. Is there a GitHub repo for enum34? Couldn't find a link to it on the PyPI
page.
The repo is at: https://bitbucket.org/stoneleaf/enum34
2. Aren't 'name' and 'value' already included in `added_behavior`?
They didn't used to be, but they are now. I'll
Changes by Ethan Furman et...@stoneleaf.us:
--
nosy: +ethan.furman
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22680
___
___
Python-bugs-list
Changes by Ethan Furman et...@stoneleaf.us:
--
resolution: - fixed
stage: patch review - resolved
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20689
Changes by Ethan Furman et...@stoneleaf.us:
--
nosy: +ethan.furman
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22656
___
___
Python-bugs-list
Ethan Furman added the comment:
Yeah, that was interesting. ;)
I think there are two different, yet related, issues:
- which __doc__ should help display?
- how should __doc__ be inherited?
The issue we should deal with here is the first, as what help displays does not
have to follow
Ethan Furman added the comment:
Patch attached for the __doc__ attribute.
--
keywords: +patch
nosy: +ethan.furman
stage: needs patch - patch review
Added file: http://bugs.python.org/file36956/issue7186.stoneleaf.01.patch
___
Python tracker rep
Changes by Ethan Furman et...@stoneleaf.us:
--
resolution: - fixed
stage: patch review - resolved
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7186
Changes by Ethan Furman et...@stoneleaf.us:
--
versions: +Python 3.4, Python 3.5 -Python 2.7, Python 3.1, Python 3.2
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7186
Ethan Furman added the comment:
As I said in msg209237:
The containers are there to help with discoverability. If you want to know
what
all the (common) AF values are you can either do
[name for name
Changes by Ethan Furman et...@stoneleaf.us:
--
assignee: - ethan.furman
resolution: - fixed
stage: test needed - resolved
status: open - closed
versions: +Python 3.5
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22506
Changes by Ethan Furman et...@stoneleaf.us:
--
resolution: - fixed
stage: patch review - resolved
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20386
Ethan Furman added the comment:
Code looks good.
Only downside is the change in help and inspect.signature output, but that is
minor:
Help on dict object:
class dict(object)
[...]
| __init__(self, /, *args, **kwargs)
vs.
Help on class Counter in module collections:
class Counter
Ethan Furman added the comment:
Like Georg I am sympathetic to the problem, but this is not the correct
solution.
You might post a question on python-list to see if a usable, not-to-painful
solution can be found.
--
nosy: +ethan.furman
status: pending - open
Ethan Furman added the comment:
I will take a look.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22609
___
___
Python-bugs-list mailing list
Changes by Ethan Furman et...@stoneleaf.us:
--
nosy: +ethan.furman
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22609
___
___
Python-bugs-list
Ethan Furman added the comment:
Sample code:
class AutoEnum(enum.Enum):
Automatically numbers enum members starting from 1.
Includes support for a custom docstring per member.
__last_number__
Ethan Furman added the comment:
Yes, the 'huh' function would have to be in either AutoEnum or AddressSegment
to be included in the dir of an AddressSegment member.
Here's a shorter example:
(this works)
class SuperEnum(Enum):
pass
Ethan Furman added the comment:
We are not rushing into code, we are getting some code, and tests, written to
help define what we are talking about.
So far the feedback has given some more tests to add, and some things to change
(such as only comparing with other Counters).
The big question
1201 - 1300 of 1854 matches
Mail list logo