[issue39430] tarfile.open(mode="r") race condition when importing lzma

2020-01-24 Thread Ethan Furman
Ethan Furman added the comment: Brett: -- > It's covered in the language reference where import semantics are > explained. It isn't explicitly called out in higher-level docs that > I'm aware of because it only really comes up in edge cases like > importing in a thread which

[issue39430] tarfile.open(mode="r") race condition when importing lzma

2020-01-24 Thread Ethan Furman
Ethan Furman added the comment: New changeset 9017e0bd5e124ae6d2ed94b9e9cacb2e86270980 by Ethan Furman (Serhiy Storchaka) in branch 'master': bpo-39430: Fix race condition in lazy imports in tarfile. (GH-18161) https://github.com/python/cpython/commit/9017e0bd5e124ae6d2ed94b9e9cacb2e86270980

[issue39430] tarfile.open(mode="r") race condition when importing lzma

2020-01-24 Thread Ethan Furman
Ethan Furman added the comment: Thanks, Serhiy! I had no idea of those changes to import. This does raise the question, though, of whether accessing an empty module's attributes should either: - wait for the module to finish initializing; or - raise an exception immediately with better

[issue29435] Allow to pass fileobj to is_tarfile

2020-01-22 Thread Ethan Furman
Ethan Furman added the comment: Thanks, William! -- assignee: -> ethan.furman resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python

[issue29435] Allow to pass fileobj to is_tarfile

2020-01-22 Thread Ethan Furman
Ethan Furman added the comment: New changeset dd754caf144009f0569dda5053465ba2accb7b4d by Ethan Furman (William Woodruff) in branch 'master': bpo-29435: Allow is_tarfile to take a filelike obj (GH-18090) https://github.com/python/cpython/commit/dd754caf144009f0569dda5053465ba2accb7b4d

[issue18819] tarfile fills devmajor and devminor fields even for non-devices

2020-01-21 Thread Ethan Furman
Ethan Furman added the comment: Thanks for moving this issue forward, William! -- assignee: -> ethan.furman stage: patch review -> test needed ___ Python tracker <https://bugs.python.org/i

[issue39234] `enum.auto()` incrementation value not specified.

2020-01-06 Thread Ethan Furman
Ethan Furman added the comment: New changeset 2e9012a3e1e316c54e27f51ba5849ba06eab7da2 by Ethan Furman (YoSTEALTH) in branch 'master': bpo-39234: Doc: `enum.auto()` incrementation value not specified. (GH-17872) https://github.com/python/cpython/commit

[issue39234] `enum.auto()` incrementation value not specified.

2020-01-06 Thread Ethan Furman
Ethan Furman added the comment: `auto()` starts with 1 because Enum numbering starts at 1 (which is in the docs, albeit buried in the Functional API section). Thank you for your effort to save somebody else from that frustration, though, I appreciate it. -- nosy: +ethan.furman

[issue38967] Improve error message in enum for member name surrounded by underscore.

2019-12-30 Thread Ethan Furman
Ethan Furman added the comment: Rubén, good idea. I wonder, though, if we should say: _sunder_ names, such as "%s", are reserved for future Enum use since `_sunder_` is used in the Enum docs and is unlikely to be confused with one's own variable name. -

[issue39102] Increase Enum performance

2019-12-19 Thread Ethan Furman
Change by Ethan Furman : -- assignee: -> ethan.furman ___ Python tracker <https://bugs.python.org/issue39102> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue39081] pathlib '/' operator does not resolve Enums with str mixin as expected

2019-12-18 Thread Ethan Furman
Ethan Furman added the comment: The other option is to continue to inherit from `str`, but override the `__str__` method: class MyEnum(str, enum.Enum): # def __str__(self): return self.value -- ___ Python tracker

[issue39017] Infinite loop in the tarfile module

2019-12-10 Thread Ethan Furman
Change by Ethan Furman : -- stage: -> test needed ___ Python tracker <https://bugs.python.org/issue39017> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue24764] cgi.FieldStorage can't parse multipart part headers with Content-Length and no filename in Content-Disposition

2019-12-03 Thread Ethan Furman
Change by Ethan Furman : -- assignee: -> ethan.furman nosy: +Rhodri James, ethan.furman ___ Python tracker <https://bugs.python.org/issue24764> ___ ___ Py

[issue27777] cgi.FieldStorage can't parse simple body with Content-Length and no Content-Disposition

2019-12-03 Thread Ethan Furman
Change by Ethan Furman : -- assignee: -> ethan.furman nosy: +Rhodri James, ethan.furman versions: -Python 3.5 ___ Python tracker <https://bugs.python.org/issu

[issue38045] enum.Flag instance creation is slow

2019-11-26 Thread Ethan Furman
Ethan Furman added the comment: New changeset 0b41a922f95f62b620d5a197b9f2ed8e4bb70730 by Ethan Furman (HongWeipeng) in branch 'master': bpo-38045: Improve the performance of _decompose() in enum.py (GH-16483) https://github.com/python/cpython/commit/0b41a922f95f62b620d5a197b9f2ed8e4bb70730

[issue29167] Race condition in enum.py:_decompose()

2019-11-25 Thread Ethan Furman
Ethan Furman added the comment: The latest patch from issue38045 should make race-conditions non-existent. -- ___ Python tracker <https://bugs.python.org/issue29

[issue28577] ipaddress.ip_network(...).hosts() returns nothing for an IPv4 /32

2019-11-04 Thread Ethan Furman
Ethan Furman added the comment: I came across this /32 issue today trying to iterate over the hosts in 127.0.0.1/32. I think it's fair to say that any /32 network has precisely one host, and that host should by returned by IPv4Network().hosts(). -- nosy: +ethan.furman

[issue38659] enum classes cause slow startup time

2019-11-01 Thread Ethan Furman
Ethan Furman added the comment: I was just looking at this problem, and creating a bare-bones, no safety belts version for use in the stdlib (no patch yet) which decreases Enum creation from 14x slower to only 6x slower. (Comparing to a class with simple attributes.) Not sure if that's

[issue38375] Enum lookup fails for callable values

2019-10-07 Thread Ethan Furman
Ethan Furman added the comment: This is the intended, and documented, behavior. -- assignee: -> ethan.furman resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python

[issue21705] cgi.py: Multipart with more than one file is misparsed

2019-09-25 Thread Ethan Furman
Ethan Furman added the comment: Excellent, thanks for checking! -- ___ Python tracker <https://bugs.python.org/issue21705> ___ ___ Python-bugs-list mailin

[issue38215] Do not import modules in star-import when __all__ is not defined.

2019-09-18 Thread Ethan Furman
Ethan Furman added the comment: It's the casual users' code that will break. -- ___ Python tracker <https://bugs.python.org/issue38215> ___ ___ Python-bug

[issue38215] Do not import modules in star-import when __all__ is not defined.

2019-09-18 Thread Ethan Furman
Ethan Furman added the comment: I don't think this is worth the code breakage. The advice already given is not to use `import *` unless: - the module was designed for that usage; or - you know what you are doing. -- nosy: +ethan.furman ___ Python

[issue21705] cgi.py: Multipart with more than one file is misparsed

2019-09-16 Thread Ethan Furman
Ethan Furman added the comment: The last status was "test-needed" -- has anyone verified that a test exists for this scenario? -- ___ Python tracker <https://bugs.python.o

[issue37830] continue in finally with return in try results with segfault

2019-08-13 Thread Ethan Furman
Ethan Furman added the comment: My apologies if I missed something, but do we have a consensus on the desired solution? My understanding of `try/finally` is that whatever happens in the `finally` clause should: - always happen - win any conflicts with `try` clause For example: try

[issue1047397] cgitb failures

2019-07-29 Thread Ethan Furman
Change by Ethan Furman : -- nosy: +Rhodri James, ethan.furman ___ Python tracker <https://bugs.python.org/issue1047397> ___ ___ Python-bugs-list mailin

[issue34443] enum repr should use __qualname__

2019-07-18 Thread Ethan Furman
Ethan Furman added the comment: New changeset 323842c2792a81e87917790506ec3457832c84b3 by Ethan Furman (Walter Dörwald) in branch 'master': bpo-34443: Use __qualname__ instead of __name__ in enum exception messages. (GH-14809) https://github.com/python/cpython/commit

[issue33976] Enums don't support nested classes

2019-07-17 Thread Ethan Furman
Ethan Furman added the comment: Edward, I'm inclined to agree with you. It will take a couple versions for deprecation, etc., to push this through (assuming nobody comes up with a good counter-argument). In the mean-time, this change has landed in aenum [1] so you can use it now. [1

[issue34443] enum repr should use __qualname__

2019-07-16 Thread Ethan Furman
Ethan Furman added the comment: If someone would like to make a PR for using __qualname__ in error messages that would be great. :) -- stage: test needed -> needs patch ___ Python tracker <https://bugs.python.org/issu

[issue34443] enum repr should use __qualname__

2019-07-16 Thread Ethan Furman
Ethan Furman added the comment: Both are good suggestions. The first should definitely happen. I'll investigate the second. -- resolution: rejected -> stage: resolved -> test needed status: closed -> open ___ Python tracke

[issue29577] Enum: mixin classes don't mix well with already mixed Enums

2019-07-15 Thread Ethan Furman
Change by Ethan Furman : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> behavior ___ Python tracker <https://bugs.python

[issue34443] enum repr should use __qualname__

2019-07-15 Thread Ethan Furman
Change by Ethan Furman : -- resolution: -> rejected stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue34536] Enum._missing_ doesn't raise TypeError when a non-Enum object is a returned

2019-07-15 Thread Ethan Furman
Change by Ethan Furman : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue37479] IntEnum __format__ behavior can't be overridden through __str__

2019-07-04 Thread Ethan Furman
Ethan Furman added the comment: New changeset 2f19e82fbe98ce86bcd98a176328af2808b678e8 by Ethan Furman (thatneat) in branch 'master': bpo-37479: on Enum subclasses with mixins, __format__ uses overridden __str__ (GH-14545) https://github.com/python/cpython/commit

[issue37479] IntEnum f-string behavior can't be overridden

2019-07-01 Thread Ethan Furman
Change by Ethan Furman : -- assignee: -> ethan.furman nosy: +ethan.furman ___ Python tracker <https://bugs.python.org/issue37479> ___ ___ Python-bugs-list mai

[issue31369] re.RegexFlag is not included in __all__, makes type inference less useful

2019-03-25 Thread Ethan Furman
Ethan Furman added the comment: I see no reason no prefix `RegexFlag` with an `_`. As far as adding it to `__all__` -- I didn't originally because I was trying to mirror the original implementation, but I am not against it. I would defer that decision to those that work on typing

[issue35899] '_is_sunder' function in 'enum' module fails on empty string

2019-03-03 Thread Ethan Furman
Ethan Furman added the comment: Thank you, everyone! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.6, Python 3.8 ___ Python tracker <https://bugs.python.or

[issue35899] '_is_sunder' function in 'enum' module fails on empty string

2019-02-21 Thread Ethan Furman
Ethan Furman added the comment: The changes to `_is_sunder` and `_is_dunder` look good, but there is a problem with the underlying assumptions of what Enum should be doing: - nameless members are not to be allowed - non-alphanumeric characters are not supported In other words, while

[issue35899] '_is_sunder' function in 'enum' module fails on empty string

2019-02-10 Thread Ethan Furman
Ethan Furman added the comment: Let's give Maxwell until the 14th (so a week from when I asked him to turn his code into a patch) and if nothing from him by then you are welcome to take it over. -- ___ Python tracker <https://bugs.python.

[issue35899] '_is_sunder' function in 'enum' module fails on empty string

2019-02-07 Thread Ethan Furman
Ethan Furman added the comment: Yes, the first solution will be fine. Maxwell, can you create a github pull request with that? -- keywords: +easy stage: -> needs patch type: crash -> behavior ___ Python tracker <https://bugs.p

[issue35717] enum.Enum error on sys._getframe(2)

2019-01-11 Thread Ethan Furman
Change by Ethan Furman : -- pull_requests: -11107 ___ Python tracker <https://bugs.python.org/issue35717> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35717] enum.Enum error on sys._getframe(2)

2019-01-11 Thread Ethan Furman
Ethan Furman added the comment: That PR does not go with this issue. ;) -- ___ Python tracker <https://bugs.python.org/issue35717> ___ ___ Python-bugs-list m

[issue35717] enum.Enum error on sys._getframe(2)

2019-01-11 Thread Ethan Furman
Ethan Furman added the comment: Marking this as "easy". It needs a test showing the failing behavior, then the fix. -- keywords: +easy ___ Python tracker <https://bugs.python.o

[issue35717] enum.Enum error on sys._getframe(2)

2019-01-11 Thread Ethan Furman
Ethan Furman added the comment: Looks like the following code: if module is None: try: module = sys._getframe(2).f_globals['__name__'] except (AttributeError, ValueError) as exc: pass needs to have `KeyError` added

[issue35585] Speedup Enum lookup

2018-12-26 Thread Ethan Furman
Ethan Furman added the comment: New changeset 34ae04f74dcf4ac97d07c3e82eaf8f619d80cedb by Ethan Furman (Andrew Svetlov) in branch 'master': Speed-up building enums by value, e.g. http.HTTPStatus(200) (#11318) https://github.com/python/cpython/commit/34ae04f74dcf4ac97d07c3e82eaf8f619d80cedb

[issue34909] StrEnum subclasses cannot be created

2018-10-20 Thread Ethan Furman
Ethan Furman added the comment: Thank you both. -- ___ Python tracker <https://bugs.python.org/issue34909> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34536] Enum._missing_ doesn't raise TypeError when a non-Enum object is a returned

2018-10-19 Thread Ethan Furman
Ethan Furman added the comment: New changeset 4acf6c9d4be77b968fa498569d7a1545e5e77344 by Ethan Furman (Victor Stinner) in branch 'master': bpo-34536: Cleanup test_enum imports (GH-9979) https://github.com/python/cpython/commit/4acf6c9d4be77b968fa498569d7a1545e5e77344

[issue34536] Enum._missing_ doesn't raise TypeError when a non-Enum object is a returned

2018-10-19 Thread Ethan Furman
Ethan Furman added the comment: New changeset 0f2fc8bee0b435ee2934751264196db30d16ed8a by Ethan Furman (Victor Stinner) in branch '3.7': bpo-34536: raise error for invalid _missing_ results (GH-9147) (GH-9978) https://github.com/python/cpython/commit/0f2fc8bee0b435ee2934751264196db30d16ed8a

[issue34536] Enum._missing_ doesn't raise TypeError when a non-Enum object is a returned

2018-10-19 Thread Ethan Furman
Ethan Furman added the comment: Change by STINNER Victor: > pull_requests: +9319 Why does the above say 9319 when the PR is 9978? -- ___ Python tracker <https://bugs.python.org/issu

[issue34909] StrEnum subclasses cannot be created

2018-10-17 Thread Ethan Furman
Ethan Furman added the comment: Okay, the patch is here: https://github.com/ethanfurman/cpython/tree/enum_news_entry But I managed to screw something up, and my wife just got hit by a car so this is now a really low priority. Ned, if you could grab the relevant pieces from the wreck

[issue34909] StrEnum subclasses cannot be created

2018-10-17 Thread Ethan Furman
Ethan Furman added the comment: Working on getting that news entry. -- ___ Python tracker <https://bugs.python.org/issue34909> ___ ___ Python-bugs-list mailin

[issue34909] StrEnum subclasses cannot be created

2018-10-15 Thread Ethan Furman
Ethan Furman added the comment: On 10/12/2018 09:52 PM, Ned Deily wrote: > Can you please merge a NEWS item for this issue using blurb since it > is a user-visible problem? I'll cherry-pick it into the 3.7.1 final. I don't believe the problem exists in 3.7.0 -- but I also don't kn

[issue34909] StrEnum subclasses cannot be created

2018-10-06 Thread Ethan Furman
Ethan Furman added the comment: Stéphane, thanks for the tip about bisect! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue34909] StrEnum subclasses cannot be created

2018-10-06 Thread Ethan Furman
Ethan Furman added the comment: New changeset 453b3b0e87cb16345c276b9064a4480ce3794a74 by Ethan Furman (Miss Islington (bot)) in branch '3.7': bpo-34909: keep searching mixins until base class is found (GH-9737) (GH-9738) https://github.com/python/cpython/commit

[issue34909] StrEnum subclasses cannot be created

2018-10-06 Thread Ethan Furman
Ethan Furman added the comment: New changeset cd45385ffad8910293e5659cfe7ab036e70613b7 by Ethan Furman in branch 'master': bpo-34909: keep searching mixins until base class is found (GH-9737) https://github.com/python/cpython/commit/cd45385ffad8910293e5659cfe7ab036e70613b7

[issue34909] StrEnum subclasses cannot be created

2018-10-05 Thread Ethan Furman
Change by Ethan Furman : -- keywords: +patch pull_requests: +9124 stage: needs patch -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue34282] Enum._convert shadows members named _convert

2018-10-05 Thread Ethan Furman
Ethan Furman added the comment: New changeset 22e86fbbca04d251233fc07515885d2b67945094 by Ethan Furman (Miss Islington (bot)) in branch '3.6': [3.7] bpo-34282: Fix Enum._convert method shadowing members named _convert (GH-9034) (GH-9229) https://github.com/python/cpython/commit

[issue34909] StrEnum subclasses cannot be created

2018-10-05 Thread Ethan Furman
Ethan Furman added the comment: It really is. I got a message from Michal Arbet from OpenStack about it. I just finished the fix and am currently running the tests locally. Is it okay to have the PR directly against 3.7 instead of doing 3.8 first and backporting? -- stage: test

[issue34909] StrEnum subclasses cannot be created

2018-10-05 Thread Ethan Furman
New submission from Ethan Furman : from enum import Enum, unique class StrEnum(str, Enum): def __new__(cls, *args, **kwargs): for a in args: if not isinstance(a, str): raise TypeError("Enumeration '%s

[issue29577] Enum: mixin classes don't mix well with already mixed Enums

2018-09-21 Thread Ethan Furman
Ethan Furman added the comment: New changeset 0c076caaa82a9c6596e1fe1dbe6384d53f30a1a3 by Ethan Furman in branch '3.7': [3.7] bpo-29577: Enum: mixin classes don't mix well with already mixed Enums (GH-9328) (GH-9486) https://github.com/python/cpython/commit

[issue29577] Enum: mixin classes don't mix well with already mixed Enums

2018-09-21 Thread Ethan Furman
Change by Ethan Furman : -- pull_requests: +8896 ___ Python tracker <https://bugs.python.org/issue29577> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue29577] Enum: mixin classes don't mix well with already mixed Enums

2018-09-21 Thread Ethan Furman
Ethan Furman added the comment: New changeset 5bdab641da0afd8aa581dfbde4f82d88d337c4b5 by Ethan Furman in branch 'master': bpo-29577: Enum: mixin classes don't mix well with already mixed Enums (GH-9328) https://github.com/python/cpython/commit/5bdab641da0afd8aa581dfbde4f82d88d337c4b5

[issue34750] locals().update doesn't work in Enum body, even though direct assignment to locals() does

2018-09-20 Thread Ethan Furman
Ethan Furman added the comment: `locals()` returns the dictionary being used (an _EnumDict) and direct assignment uses the `__setitem__` method, which has been overridden -- and it is the only one; so `update()`, etc., still have normal dict meanings and not Enum ones. Next step: compile

[issue29577] Enum: mixin classes don't mix well with already mixed Enums

2018-09-14 Thread Ethan Furman
Change by Ethan Furman : -- keywords: +patch pull_requests: +8751 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue29577> ___ ___ Py

[issue34536] Enum._missing_ doesn't raise TypeError when a non-Enum object is a returned

2018-09-12 Thread Ethan Furman
Ethan Furman added the comment: New changeset 019f0a0cb85ebc234356415f3638b9bd77528e55 by Ethan Furman in branch 'master': bpo-34536: raise error for invalid _missing_ results (GH-9147) https://github.com/python/cpython/commit/019f0a0cb85ebc234356415f3638b9bd77528e55

[issue29577] Enum: mixin classes don't mix well with already mixed Enums

2018-09-12 Thread Ethan Furman
Change by Ethan Furman : -- versions: +Python 3.8 -Python 3.6, Python 3.7 ___ Python tracker <https://bugs.python.org/issue29577> ___ ___ Python-bugs-list mailin

[issue34282] Enum._convert shadows members named _convert

2018-09-12 Thread Ethan Furman
Ethan Furman added the comment: New changeset 0fb9fadd3b3e9e3698647e0b92d49b0b7aacd979 by Ethan Furman (orlnub123) in branch 'master': bpo-34282: Fix Enum._convert shadowing members named _convert (GH-8568) https://github.com/python/cpython/commit/0fb9fadd3b3e9e3698647e0b92d49b0b7aacd979

[issue34536] Enum._missing_ doesn't raise TypeError when a non-Enum object is a returned

2018-09-11 Thread Ethan Furman
Change by Ethan Furman : -- keywords: +patch, patch, patch pull_requests: +8636, 8637, 8638 stage: -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue34536] Enum._missing_ doesn't raise TypeError when a non-Enum object is a returned

2018-09-11 Thread Ethan Furman
Change by Ethan Furman : -- keywords: +patch, patch pull_requests: +8636, 8637 stage: -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue34536] Enum._missing_ doesn't raise TypeError when a non-Enum object is a returned

2018-09-11 Thread Ethan Furman
Change by Ethan Furman : -- keywords: +patch pull_requests: +8636 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue34536> ___ ___ Py

[issue34443] enum repr should use __qualname__

2018-09-11 Thread Ethan Furman
Ethan Furman added the comment: Okay, I might be changing my mind. In most cases I suspect the difference would be minimal, but when it isn't, it really isn't. Take this example from a pydoc test: class Color(enum.Enum) | Color(value, names=None, *, module=None, qualname=None, type

[issue34443] enum repr should use __qualname__

2018-09-11 Thread Ethan Furman
Ethan Furman added the comment: Serhiy said: --- > I think using more longer name in repr and/or str for *instances* of > enum classes is not good idea. They are already verbose, and this > will make them more verbose. I'm okay with verbose reprs, as debugging is the primar

[issue34082] EnumMeta.__new__ should use enum_class.__new__

2018-09-10 Thread Ethan Furman
Ethan Furman added the comment: The solution to 29577 will also fix this. -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Enum: mixin classes don't mix well with already mixed Enums ___ Python tra

[issue33437] Defining __init__ in enums

2018-09-10 Thread Ethan Furman
Change by Ethan Furman : -- pull_requests: +8593 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue33437> ___ ___ Python-bugs-list mai

[issue31801] vars() manipulation encounters problems with Enum

2018-09-10 Thread Ethan Furman
Change by Ethan Furman : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue33217] x in enum.Flag member is True when x is not a Flag

2018-09-10 Thread Ethan Furman
Ethan Furman added the comment: Thank you, Rahul! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue33217] x in enum.Flag member is True when x is not a Flag

2018-09-10 Thread Ethan Furman
Ethan Furman added the comment: New changeset 9430652535f88125d8003f342a8884d34885d876 by Ethan Furman (Rahul Jha) in branch 'master': bpo-33217: Raise TypeError for non-Enum lookups in Enums (GH-6651) https://github.com/python/cpython/commit/9430652535f88125d8003f342a8884d34885d876

[issue34487] enum _sunder_ names mix metaclass and enum class attributes

2018-09-10 Thread Ethan Furman
Change by Ethan Furman : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue34487> ___ ___

[issue34282] Enum._convert shadows members named _convert

2018-09-10 Thread Ethan Furman
Ethan Furman added the comment: New changeset c0d63bf73b35df374e6e66c08b0e297fb828d744 by Ethan Furman (orlnub123) in branch '3.7': [3.7] bpo-34282: Fix Enum._convert method shadowing members named _convert (GH-9034) https://github.com/python/cpython/commit

[issue34282] Enum._convert shadows members named _convert

2018-09-01 Thread Ethan Furman
Ethan Furman added the comment: orlnub123 wrote: --- > In my testings _convert has always been available to them as they all > subclass Enum where it's defined. Wow, I really shouldn't check for things in the middle of the night. On the bright side, no further changes are

[issue34282] Enum._convert shadows members named _convert

2018-09-01 Thread Ethan Furman
Ethan Furman added the comment: On 09/01/2018 01:21 AM, orlnub123 wrote: > On 08/31/2018 03:01 ethan.furman wrote: >> For versions 3.6 and 3.7 the solution is to modify the shadow check at >> line 236 so only DynamicClassAttributes are /not/ shadowed (meaning >> the

[issue34536] Enum._missing_ doesn't raise TypeError when a non-Enum object is a returned

2018-08-31 Thread Ethan Furman
Change by Ethan Furman : -- assignee: -> ethan.furman nosy: +ethan.furman ___ Python tracker <https://bugs.python.org/issue34536> ___ ___ Python-bugs-list mai

[issue34282] Enum._convert shadows members named _convert

2018-08-31 Thread Ethan Furman
Ethan Furman added the comment: For versions 3.6 and 3.7 the solution is to modify the shadow check at line 236 so only DynamicClassAttributes are /not/ shadowed (meaning the _convert method would be shadowed by an _convert member). For 3.8 we can move _convert to the metaclass: I wasn't

[issue34282] Enum._convert shadows members named _convert

2018-08-31 Thread Ethan Furman
Change by Ethan Furman : -- Removed message: https://bugs.python.org/msg324414 ___ Python tracker <https://bugs.python.org/issue34282> ___ ___ Python-bugs-list m

[issue34282] Enum._convert shadows members named _convert

2018-08-31 Thread Ethan Furman
Ethan Furman added the comment: For versions 3.6 and 3.7 the solution is to modify the shadow check at line 236 so only DynamicClassAttributes are /not/ shadowed (meaning the _convert method would be shadowed by an _convert member). For 3.8 we can move _convert to the metaclass: I wasn't

[issue27923] PEP 467 -- Minor API improvements for binary sequences

2018-08-30 Thread Ethan Furman
Change by Ethan Furman : -- assignee: -> ethan.furman ___ Python tracker <https://bugs.python.org/issue27923> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue34487] enum _sunder_ names mix metaclass and enum class attributes

2018-08-27 Thread Ethan Furman
Ethan Furman added the comment: All those attributes live in the Enum class. If you use a non-existent attribute, such as _name, then the metaclass will be called to check if that name is actually an Enum member. -- assignee: docs@python -> ethan.furman nosy: +ethan.fur

[issue34443] enum repr should use __qualname__

2018-08-20 Thread Ethan Furman
Change by Ethan Furman : -- assignee: -> ethan.furman ___ Python tracker <https://bugs.python.org/issue34443> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue30545] Enum equality across modules: comparing objects instead of values

2018-08-12 Thread Ethan Furman
Ethan Furman added the comment: What you have discovered is not Enum specific, but in fact can happen with any module (as stated in my first comment in this bug report). Maybe these SO question will help: https://stackoverflow.com/q/2489601/208880 https://stackoverflow.com/a/4798648/208880

[issue30545] Enum equality across modules: comparing objects instead of values

2018-08-11 Thread Ethan Furman
Ethan Furman added the comment: Markus Wegmann said: > In the appendix, you find a toy project with similar structure, which > in > contrast to `flora_tools` works flawlessly. I appreciate your attempt to reproduce the problem, but since you weren't able to,

[issue34082] EnumMeta.__new__ should use enum_class.__new__

2018-07-10 Thread Ethan Furman
Change by Ethan Furman : -- assignee: -> ethan.furman nosy: +barry, eli.bendersky, ethan.furman ___ Python tracker <https://bugs.python.org/issue34082> ___ _

[issue33976] Enums don't support nested classes

2018-06-27 Thread Ethan Furman
Ethan Furman added the comment: Edward, thank you for taking the time to submit a patch, complete with tests! Do you have a real-world example of why Enum should work this way? -- assignee: -> ethan.furman nosy: +barry, eli.bendersky, ethan.fur

[issue33863] Enum doc correction relating to __members__

2018-06-15 Thread Ethan Furman
Ethan Furman added the comment: Closing as a duplicate of #33866. My apologies for the fractured discussion. At this point I'm going to leave/update the documentation using "an ordered dictionary". See #33866 for further discussion. -- assignee: -> ethan.furm

[issue33860] doc Avoid "ordered dictionary" references now that dictionaries are ordered

2018-06-15 Thread Ethan Furman
Ethan Furman added the comment: As I said on the PR: This feels like an unnecessary change. The phrase "ordered dictionary" does not always refer to an 'OrderedDict`, and there is more than one way to order a dictionary besides insertion order. As a side note: it's generally bett

[issue33866] Stop using OrderedDict in enum

2018-06-15 Thread Ethan Furman
Change by Ethan Furman : -- assignee: -> ethan.furman nosy: +barry, eli.bendersky, ethan.furman ___ Python tracker <https://bugs.python.org/issue33866> ___ _

[issue33863] Enum doc correction relating to __members__

2018-06-14 Thread Ethan Furman
Ethan Furman added the comment: An ordered mapping sounds good to me. Let's let this sit for a couple days in case anyone else wants to chime in. If there are no other ideas or objections then we can make the change mid-next week. -- ___ Python

[issue33863] Enum doc correction relating to __members__

2018-06-14 Thread Ethan Furman
Ethan Furman added the comment: I am open to suggestions, but I will say that there are other types of ordered dictionaries besides OrderedDict. Also, if you have some generic dictionary that happens to be ordered but is not an OrderedDict, how would you describe

[issue33863] Enum doc correction relating to __members__

2018-06-14 Thread Ethan Furman
New submission from Ethan Furman : Checking the docs for Enum I see that section 8.13.15.3.1 says: `__members__` is an `OrderedDict` which is incorrect. It should say "an ordered dictionary". -- messages: 319543 nosy: adelfino, barry, eli.bendersky, ethan.furman priori

[issue33862] doc Fix Enum __members__ type

2018-06-14 Thread Ethan Furman
Ethan Furman added the comment: Serhiy is correct. The exact return type only needs to be ordered, and have appropriate dictionary methods such as `keys()`, `values()`, and `items()`. The reason a mappingproxy was chosen is exactly because what you just tried is illegal and/or confusing

[issue31947] names=None case is not handled by EnumMeta._create_ method

2018-05-15 Thread Ethan Furman
Ethan Furman <et...@stoneleaf.us> added the comment: Thank you, Anentropic! -- assignee: -> ethan.furman resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <rep...@bu

[issue31947] names=None case is not handled by EnumMeta._create_ method

2018-05-15 Thread Ethan Furman
Ethan Furman <et...@stoneleaf.us> added the comment: New changeset c50e5b1f1f2501f697aa52d9c9a440bdeced7006 by Ethan Furman (Miss Islington (bot)) in branch '3.6': bpo-31947: remove None default for names param in Enum._create_ GH-4288 (GH-6485) https://github.com/python/cpython/

<    1   2   3   4   5   6   7   8   9   10   >