Ethan Furman added the comment:
Not trying to push, but if I don't write it down now, I'll forget later. ;)
What does adding new members gain us? If I have a func xyz() that's expecting
a Color, a MoreColor will work sometimes and blow up other times.
Or are you saying tha
Ethan Furman added the comment:
I believe Guido will be happy to replace the frame hack once we have something
better, such as a way to implicitly (or explicitly in the case of helper
functions) pass the calling module's name.
Maybe a global __calling_module__ that a function can lo
Ethan Furman added the comment:
Here's the latest patch.
Note that the functional API portion is broken, and I'll get back to that this
evening. Please only comment on the working code. ;)
I'll make that _MemborOrProperty name change then as well.
--
A
Ethan Furman added the comment:
The class syntax (and default Enum) no longer have preferential treatment for
integers (even __int__ is gone); so it is completely up to us as what should
happen for the functional syntax.
--
___
Python tracker
Changes by Ethan Furman :
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue17960>
___
___
Python-bugs-list mailing list
Unsubscribe:
Ethan Furman added the comment:
On 05/12/2013 06:57 PM, Barry A. Warsaw wrote:
>
> Do you really think the enum discussion on python-dev was too short and could
> use another few thousand messages? ;)
No!
> Or IOW, hasn't this already been decided by virtue of PEP acceptanc
Ethan Furman added the comment:
So the repr will look like:
?
--
___
Python tracker
<http://bugs.python.org/issue17961>
___
___
Python-bugs-list mailin
Ethan Furman added the comment:
Got the pickle issues worked out. Added super to the metaclass' __new__.
Checking for illegal names of members and raising ValueError if any are found
(I know, I know, safety checks! But such an enum is broken from the getgo so I
see no reason to allow
Changes by Ethan Furman :
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue18001>
___
___
Python-bugs-list mailing list
Unsubscribe:
Ethan Furman added the comment:
Your interest if fixing Python is appreciated, but you need to verify that a
bug actually exists first:
Python 2.7.3 (default, Sep 26 2012, 21:51:14)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "licen
Ethan Furman added the comment:
Antoine, do you want to pursue, or can we close this?
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue3
Ethan Furman added the comment:
David, is this still a need? Or, put another way, has Python change enough in
the last 11 years that you can now do what you wanted?
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue515
Changes by Ethan Furman :
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue8297>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Ethan Furman :
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue18009>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Ethan Furman :
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue18011>
___
___
Python-bugs-list mailing list
Unsubscribe:
Ethan Furman added the comment:
This is certainly an effective method, but it places safety off by default. I
would rather have a system that was from duplicates by default but had an easy
override.
The method I had in place in my original code was something like:
class Color(Enum, options
Ethan Furman added the comment:
I'm not giving up hope yet. Plenty of Python features no longer work the way
they did when their PEP was accepted. ;)
--
___
Python tracker
<http://bugs.python.org/is
Ethan Furman added the comment:
Oh. Well, I like your decorator. :)
--
___
Python tracker
<http://bugs.python.org/issue18042>
___
___
Python-bugs-list mailin
Ethan Furman added the comment:
Sample code:
class AutoEnum(enum.Enum):
"""
Automatically numbers enum members starting from 1.
Includes support for a custom docst
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(
Changes by Ethan Furman :
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue22609>
___
___
Python-bugs-list mailing list
Unsubscribe:
Ethan Furman added the comment:
I will take a look.
--
___
Python tracker
<http://bugs.python.org/issue22609>
___
___
Python-bugs-list mailing list
Unsubscribe:
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 -> o
Changes by Ethan Furman :
--
assignee: -> ethan.furman
resolution: -> fixed
stage: test needed -> resolved
status: open -> closed
versions: +Python 3.5
___
Python tracker
<http://bugs.python
Changes by Ethan Furman :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.or
Changes by Ethan Furman :
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue22656>
___
___
Python-bugs-list mailing list
Unsubscribe:
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 the
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
&l
Changes by Ethan Furman :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.o
Changes by Ethan Furman :
--
versions: +Python 3.4, Python 3.5 -Python 2.7, Python 3.1, Python 3.2
___
Python tracker
<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
>
>
Changes by Ethan Furman :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.or
Changes by Ethan Furman :
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue22680>
___
___
Python-bugs-list mailing list
Unsubscribe:
Ethan Furman added the comment:
Thanks for the reminder!
...
Done.
--
___
Python tracker
<http://bugs.python.org/issue22506>
___
___
Python-bugs-list mailin
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 did
Changes by Ethan Furman :
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue22698>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
<http://bugs.python.org/issue22725>
___
___
Python-bugs-list mailing list
Unsubscr
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.
--
_
Changes by Ethan Furman :
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue22738>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Ethan Furman :
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue22741>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Ethan Furman :
--
assignee: -> rhettinger
nosy: +ethan.furman, rhettinger
___
Python tracker
<http://bugs.python.org/issue22766>
___
___
Python-
Changes by Ethan Furman :
--
versions: +Python 2.7, Python 3.5
___
Python tracker
<http://bugs.python.org/issue22766>
___
___
Python-bugs-list mailing list
Unsub
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
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 recen
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 ... impo
New submission from Ethan Furman:
--> s = []
--> s += 1
Traceback (most recent call last):
File "", line 1, in
TypeError: 'int' object is not iterable
For comparison, when NotImplemented is appropriately returned the message looks
like this:
--> s -= 1
Tra
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 "", line 1, in
TypeError: 'int' object is not iterable
deque should be returning NotImplemented, which would generate a mo
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 retu
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 __
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 :
--
stage: needs patch -> resolved
status: open -> closed
versions: +Python 3.5
___
Python tracker
<http://bugs.python.org/i
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 updat
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
<http://bugs.python.or
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 requ
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
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 woul
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 this
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
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 be
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 o
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
<http://bugs.python.org/issue22
Ethan Furman added the comment:
Whew!
If a different wording is better, I'm happy to change both places. :)
--
___
Python tracker
<http://bugs.python.org/is
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/
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
<http://bugs.python.o
New submission from Ethan Furman:
test script:
---
from collections import Counter
empty_counter = Counter()
counter = Counter('abbc')
empty_counter &= 5
counter &= 5
--
Changes by Ethan Furman :
Removed file: http://bugs.python.org/file37136/issue22778.stoneleaf.01.patch
___
Python tracker
<http://bugs.python.org/issue22801>
___
___
Pytho
Changes by Ethan Furman :
Added file: http://bugs.python.org/file37137/issue22778.stoneleaf.01.patch
___
Python tracker
<http://bugs.python.org/issue22801>
___
___
Pytho
Ethan Furman added the comment:
No real-world use-cases have surfaced. Many thanks to everyone's explanations
and examples.
--
___
Python tracker
<http://bugs.python.org/is
Changes by Ethan Furman :
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue9951>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Ethan Furman :
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue17900>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Ethan Furman :
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue22806>
___
___
Python-bugs-list mailing list
Unsubscribe:
Ethan Furman added the comment:
What result did you expect?
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue22840>
___
___
Python-bug
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
Changes by Ethan Furman :
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue22867>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Ethan Furman :
--
nosy: +belopolsky, ethan.furman, lemburg
___
Python tracker
<http://bugs.python.org/issue22871>
___
___
Python-bugs-list mailin
Changes by Ethan Furman :
--
nosy: +ethan.furman, jnoller, sbt
___
Python tracker
<http://bugs.python.org/issue22872>
___
___
Python-bugs-list mailing list
Unsub
Changes by Ethan Furman :
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue22873>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Ethan Furman :
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue22894>
___
___
Python-bugs-list mailing list
Unsubscribe:
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 testate
Changes by Ethan Furman :
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue22903>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Ethan Furman :
--
nosy: +ethan.furman
resolution: -> duplicate
status: open -> closed
superseder: -> deeply nested filter segfaults
___
Python tracker
<http://bugs.python.or
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
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
<http://bugs.python.org
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
<http://bugs.python.org/issu
Changes by Ethan Furman :
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue22951>
___
___
Python-bugs-list mailing list
Unsubscribe:
Ethan Furman added the comment:
Thank you, Berker.
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.or
Ethan Furman added the comment:
Fix `self` now, add a warning and single minor cycle deprecation period for
'dict'.
--
___
Python tracker
<http://bugs.python.o
Changes by Ethan Furman :
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue22986>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Ethan Furman :
--
nosy: +ethan.furman, giampaolo.rodola, gvanrossum, haypo, pitrou, yselivanov
___
Python tracker
<http://bugs.python.org/issue22
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
&g
Changes by Ethan Furman :
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue22997>
___
___
Python-bugs-list mailing list
Unsubscribe:
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 f
Changes by Ethan Furman :
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue23001>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Ethan Furman :
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue9536>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Ethan Furman :
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue23006>
___
___
Python-bugs-list mailing list
Unsubscribe:
1301 - 1400 of 1868 matches
Mail list logo