[issue39728] Instantiating enum with invalid value results in ValueError twice

2020-09-16 Thread Ethan Furman
Ethan Furman added the comment: New changeset a9ba8ba9a71f3cb8d274c354ff67b6206abeb8ac by Ethan Furman in branch '3.9': [3.9] bpo-39728: Enum: fix duplicate `ValueError` (GH-22277) (GH-22282) https://github.com/python/cpython/commit/a9ba8ba9a71f3cb8d274c354ff67b6

[issue39728] Instantiating enum with invalid value results in ValueError twice

2020-09-16 Thread Ethan Furman
Ethan Furman added the comment: New changeset 5efb1a77e75648012f8b52960c8637fc296a5c6d by Ethan Furman in branch '3.8': [3.8] bpo-39728: Enum: fix duplicate `ValueError` (GH-22277) (GH-22283) https://github.com/python/cpython/commit/5efb1a77e75648012f8b52960c8637

[issue39728] Instantiating enum with invalid value results in ValueError twice

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

[issue32218] add __iter__ to enum.Flag members

2020-09-17 Thread Ethan Furman
Change by Ethan Furman : -- components: +Library (Lib) resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10 -Python 3.8 ___ Python tracker <https://bugs.python.or

[issue32218] add __iter__ to enum.Flag members

2020-09-19 Thread Ethan Furman
Ethan Furman added the comment: Problem: What to do when the Flag has compound members? class Color(Flag): BLACK = 0 RED = 1 GREEN = 2 BLUE = 4 PURPLE = RED|BLUE WHITE = RED|GREEN|BLUE I think the answer is: only return the single members

[issue41811] pstats.SortKey enum is broken

2020-09-19 Thread Ethan Furman
New submission from Ethan Furman : Currently, __new__ creates each member as an empty string, then adds the _value_ attribute. Because of this, each member is equal to each other, and all appear the same to any data structure that relies on equality and hash as distinguishers (so, basically

[issue41811] pstats.SortKey enum is broken

2020-09-19 Thread Ethan Furman
Change by Ethan Furman : -- keywords: +patch pull_requests: +21361 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22316 ___ Python tracker <https://bugs.python.org/issu

[issue41811] pstats.SortKey enum is broken

2020-09-19 Thread Ethan Furman
Ethan Furman added the comment: New changeset ae0d2a33ec05aece939a959d36fcf1df1e210a08 by Ethan Furman in branch 'master': bpo-41811: create SortKey members using first given value (GH-22316) https://github.com/python/cpython/commit/ae0d2a33ec05aece939a959d36fcf1

[issue41816] need StrEnum in enum.py

2020-09-19 Thread Ethan Furman
New submission from Ethan Furman : Due to the nature of `str`, if an Enum tries to mixin the str type, all of it's members will be strings -- even if they didn't start out that way: class MyStrEnum(str, Enum): tuple = 'oops', okay = 'corre

[issue41817] Incorrect types in tkinter.EventType Enum

2020-09-19 Thread Ethan Furman
New submission from Ethan Furman : Several of the EventType members, such as Key, are actually tuples instead of strings. I suspect the comma was accidentally left in place when EventType was created from a different data structure. Switching the Enum type to the new StrEnum fixes the

[issue41811] pstats.SortKey enum is broken

2020-09-19 Thread Ethan Furman
Ethan Furman added the comment: New changeset 0e4d526de47eae24b75f3623cd56bb0453fc8c74 by Miss Islington (bot) in branch '3.9': bpo-41811: create SortKey members using first given value (GH-22316) (GH-22325) https://github.com/python/cpython/commit/0e4d526de47eae24b75f3623cd56bb

[issue41811] pstats.SortKey enum is broken

2020-09-19 Thread Ethan Furman
Ethan Furman added the comment: New changeset 488e3eb70d24d5ce55ae0d7aed13a3721d3eb8a1 by Miss Islington (bot) in branch '3.8': bpo-41811: create SortKey members using first given value (GH-22316) (GH-22326) https://github.com/python/cpython/commit/488e3eb70d24d5ce55ae0d7aed13a3

[issue41811] pstats.SortKey enum is broken

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

[issue40084] HTTPStatus has incomplete dir() listing

2020-09-21 Thread Ethan Furman
Change by Ethan Furman : -- versions: +Python 3.10 -Python 3.7 ___ Python tracker <https://bugs.python.org/issue40084> ___ ___ Python-bugs-list mailing list Unsub

[issue41816] need StrEnum in enum.py

2020-09-21 Thread Ethan Furman
Change by Ethan Furman : -- keywords: +patch pull_requests: +21382 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/22337 ___ Python tracker <https://bugs.python.org/issu

[issue40084] HTTPStatus has incomplete dir() listing

2020-09-21 Thread Ethan Furman
Ethan Furman added the comment: New changeset 68526fe258da8c01196fd7cf48e8e5f1280bf8fd by Angelin BOOZ in branch 'master': bpo-40084: Enum - dir() includes member attributes (GH-19219) https://github.com/python/cpython/commit/68526fe258da8c01196fd7cf48e8e5

[issue37062] `AutoNumber` class in enum documentation: support *args in constructor

2020-09-21 Thread Ethan Furman
Ethan Furman added the comment: The only `AutoNumber` in the stdlib is as an example in the docs. Were you thinking of something else? -- versions: +Python 3.10 -Python 3.9 ___ Python tracker <https://bugs.python.org/issue37

[issue41816] need StrEnum in enum.py

2020-09-21 Thread Ethan Furman
Ethan Furman added the comment: New changeset 0063ff4e583505e69473caa978e476ea4c559b83 by Ethan Furman in branch 'master': bpo-41816: add `StrEnum` (GH-22337) https://github.com/python/cpython/commit/0063ff4e583505e69473caa978e476

[issue41817] Incorrect types in tkinter.EventType Enum

2020-09-21 Thread Ethan Furman
Change by Ethan Furman : -- keywords: +patch pull_requests: +21387 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/22348 ___ Python tracker <https://bugs.python.org/issu

[issue37062] `AutoNumber` class in enum documentation: support *args in constructor

2020-09-21 Thread Ethan Furman
Change by Ethan Furman : -- keywords: +patch pull_requests: +21388 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22349 ___ Python tracker <https://bugs.python.org/issu

[issue41816] need StrEnum in enum.py

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

[issue41816] need StrEnum in enum.py

2020-09-22 Thread Ethan Furman
Ethan Furman added the comment: >From Serhiy Storchaka: - The only exception is StrEnum -- overriding __str__ of str subclass may be not safe. Some code will call str() implicitly, other will read the string content of the object directly, and they will be differ

[issue41816] need StrEnum in enum.py

2020-09-22 Thread Ethan Furman
Change by Ethan Furman : -- pull_requests: +21400 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/22362 ___ Python tracker <https://bugs.python.org/issu

[issue41817] Incorrect types in tkinter.EventType Enum

2020-09-22 Thread Ethan Furman
Ethan Furman added the comment: New changeset ea0711a9f9f207d6d4ca037d90de6ec60db131b0 by Ethan Furman in branch 'master': bpo-41817: use new StrEnum to ensure all members are strings (GH-22348) https://github.com/python/cpython/commit/ea0711a9f9f207d6d4ca037d90de6e

[issue41816] need StrEnum in enum.py

2020-09-22 Thread Ethan Furman
Ethan Furman added the comment: New changeset d986d1657e1e7b50807d0633cb31d96a2d866d42 by Ethan Furman in branch 'master': bpo-41816: `StrEnum.__str__` is `str.__str__` (GH-22362) https://github.com/python/cpython/commit/d986d1657e1e7b50807d0633cb31d9

[issue41816] need StrEnum in enum.py

2020-09-22 Thread Ethan Furman
Ethan Furman added the comment: Thank you for your help, Serhiy! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue41817] Incorrect types in tkinter.EventType Enum

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

[issue37062] `AutoNumber` class in enum documentation: support *args in constructor

2020-09-22 Thread Ethan Furman
Ethan Furman added the comment: New changeset 5acc1b5f0b62eef3258e4bc31eba3b9c659108c9 by Miss Islington (bot) in branch '3.8': bpo-37062: Enum: add extended AutoNumber example (GH-22349) (GH-22369) https://github.com/python/cpython/commit/5acc1b5f0b62eef3258e4bc31eba3b

[issue37062] `AutoNumber` class in enum documentation: support *args in constructor

2020-09-22 Thread Ethan Furman
Ethan Furman added the comment: New changeset 64362c2e435eddc5e84cea313d92bc0b96d227f7 by Miss Islington (bot) in branch '3.9': bpo-37062: Enum: add extended AutoNumber example (GH-22349) (GH-22370) https://github.com/python/cpython/commit/64362c2e435eddc5e84cea313d92bc

[issue37062] `AutoNumber` class in enum documentation: support *args in constructor

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

[issue40066] Enum._convert should change __repr__ and/or __str__ to use module name instead of class name

2020-09-23 Thread Ethan Furman
Change by Ethan Furman : -- keywords: +patch pull_requests: +21433 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22392 ___ Python tracker <https://bugs.python.org/issu

[issue40066] Enum._convert should change __repr__ and/or __str__ to use module name instead of class name

2020-09-25 Thread Ethan Furman
Ethan Furman added the comment: At this point, the PR has made the following changes: - normal Enums - repr() -> "classname.membername" - str() -> "membername" - stdlib Enums available as module attributes (RegexFlag, AddressFamily, etc.) - repr() -> &q

[issue41889] enum: Mixin and int base class regression in 3.8.6

2020-10-01 Thread Ethan Furman
Change by Ethan Furman : -- keywords: +patch pull_requests: +21505 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22487 ___ Python tracker <https://bugs.python.org/issu

[issue41889] enum: Mixin and int base class regression in 3.8.6

2020-10-01 Thread Ethan Furman
Change by Ethan Furman : -- assignee: -> ethan.furman ___ Python tracker <https://bugs.python.org/issue41889> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue41907] Regression in IntFlag behaviour in f-string

2020-10-02 Thread Ethan Furman
Ethan Furman added the comment: Thank you for the bug report. Another solution would be to subclass IntFlag and specify the `__format__` method: from enum import IntFlag as _IntFlag class IntFlag(_IntFlag): def __format__(self, spec): return format(self.value

[issue41907] Regression in IntFlag behaviour in f-string

2020-10-02 Thread Ethan Furman
Change by Ethan Furman : -- keywords: +patch pull_requests: +21515 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/22497 ___ Python tracker <https://bugs.python.org/issu

[issue41907] Regression in IntFlag behaviour in f-string

2020-10-02 Thread Ethan Furman
Change by Ethan Furman : -- components: +Library (Lib) -Interpreter Core ___ Python tracker <https://bugs.python.org/issue41907> ___ ___ Python-bugs-list mailin

[issue40066] Enum._convert should change __repr__ and/or __str__ to use module name instead of class name

2020-10-05 Thread Ethan Furman
Ethan Furman added the comment: Python-Dev thread [0], summary below: > As you may have noticed, Enums are starting to pop up all > over the stdlib [1]. > > To facilitate transforming existing module constants to > IntEnums there is `IntEnum._convert_`. In Issue36548 [2] &g

[issue42385] Should enum.auto's behavior be adjusted for StrEnum to return the enum name?

2020-11-17 Thread Ethan Furman
Ethan Furman added the comment: A good idea. Since the Python opinion of enum members is that they be upper-cased, and every magic string constant I have seen is lower-case, `StrEnum._generate_next_value_` should lower case the name. Users can substitute their own `_gnv_` for different

[issue6210] Exception Chaining missing method for suppressing context

2012-01-26 Thread Ethan Furman
Ethan Furman added the comment: Okay, here is a patch implementing the 'raise ... from None' method. All critiques appreciated (especially if they include links to learn from!). -- keywords: +patch Added file: http://bugs.python.org/file24332/raise_from

[issue6210] Exception Chaining missing method for suppressing context

2012-01-26 Thread Ethan Furman
Ethan Furman added the comment: I went with raise ... from None instead of raise as ... because there seemed to me more support for 'from None' on python-dev, possible confusion with 'raise as', and 'from None' follows the existing systax

[issue6210] Exception Chaining missing method for suppressing context

2012-01-26 Thread Ethan Furman
Ethan Furman added the comment: > 1. Any syntax change requires a PEP (and, IMO, any such PEP for this issue > should get rejected: I don't consider this an important enough feature to > deserve dedicated syntax. Others disagree, which is one of the reasons why a > PEP is

[issue6210] Exception Chaining missing method for suppressing context

2012-01-26 Thread Ethan Furman
Ethan Furman added the comment: Nick Coghlan wrote: > 1. Any syntax change requires a PEP PEP is on python-dev. -- ___ Python tracker <http://bugs.python.org/iss

[issue6210] Exception Chaining missing method for suppressing context

2012-01-28 Thread Ethan Furman
Ethan Furman added the comment: It looks like agreement is forming around the raise ... from None method. It has been mentioned more than once that having the context saved on the exception would be a Good Thing, and for further debugging (or logging or what-have-you) I must agree

[issue6210] Exception Chaining missing method for suppressing context

2012-01-29 Thread Ethan Furman
Ethan Furman added the comment: Current semantics (before patch): cause is not None --> cause is set, display it instead of context cause is None --> no cause, try to display context context is not None --> no context context is None --> context set, display it (unless c

[issue6210] Exception Chaining missing method for suppressing context

2012-01-29 Thread Ethan Furman
Ethan Furman added the comment: Patrick: The value in this enhancement is in not displaying the chained exception. I do not see any value in throwing it away completely. If you don't care about __context__ you can safely ignore it. On the other hand, if it is completely removed, an

[issue6210] Exception Chaining missing method for suppressing context

2012-01-29 Thread Ethan Furman
Ethan Furman added the comment: Not sure I have traceback._iter_chain() patched correctly, but all the tests pass. Here's the latest code. -- Added file: http://bugs.python.org/file24362/raise_from_none_v3.diff ___ Python tracker

[issue6210] Exception Chaining missing method for suppressing context

2012-01-31 Thread Ethan Furman
Ethan Furman added the comment: Attached patch now includes doc changes. -- Added file: http://bugs.python.org/file24386/raise_from_none_v4.diff ___ Python tracker <http://bugs.python.org/issue6

[issue6210] Exception Chaining missing method for suppressing context

2012-01-31 Thread Ethan Furman
Ethan Furman added the comment: Okay, *all* the documentation updates this time. Thanks, Nick! -- Added file: http://bugs.python.org/file24387/raise_from_none_v5.diff ___ Python tracker <http://bugs.python.org/issue6

[issue6210] Exception Chaining missing method for suppressing context

2012-02-02 Thread Ethan Furman
Ethan Furman added the comment: Latest version of PEP is on python-dev; here is the latest patch. Summary: For __cause__ we are replacing the old special value of None with Ellipsis: Ellipsis means check __context__ for an exception to display; None means ignore __context__ and stop

[issue6210] Exception Chaining missing method for suppressing context

2012-02-02 Thread Ethan Furman
Ethan Furman added the comment: PEP 409 has been accepted. :) Attached is the latest patch implementing it, with the (hopefully ;) final changes. Because Ellipsis is now the default value for __cause__, 'raise ... from Ellipsis' is treated the same as 'raise ...' -

[issue6210] Exception Chaining missing method for suppressing context

2012-02-03 Thread Ethan Furman
Ethan Furman added the comment: > Because Ellipsis is now the default value for __cause__, > 'raise ... from Ellipsis' is treated the same as 'raise ...' Not exactly true -- if ... is a new exception then they are the same; if ... is a caught exception that is bein

[issue6210] Exception Chaining missing method for suppressing context

2012-02-03 Thread Ethan Furman
Ethan Furman added the comment: I just noticed that no one is assigned to this issue -- anybody on the nosy list able to review? -- ___ Python tracker <http://bugs.python.org/issue6

[issue6210] Exception Chaining missing method for suppressing context

2012-02-15 Thread Ethan Furman
Ethan Furman added the comment: > Remaining problems: > - default sys.excepthook implementation currently does the wrong thing Unable to duplicate on my system (Win XP SP3) > - needs a test for the pythonrun display logic (test_cmd_line_script > would be the appropriate place)

[issue14136] Simplify PEP 409 command line test and move it to test_cmd_line_script

2012-02-28 Thread Ethan Furman
Ethan Furman added the comment: Changed TestTraceback.test_traceback_verbiage to use test.support and test.script_helper (much simpler now, thanks Antoine!). It is still in test_raise, however. I do not understand why we would put it in test_cmd_line_script -- it seems to me that

[issue14136] Simplify PEP 409 command line test and move it to test_cmd_line_script

2012-02-28 Thread Ethan Furman
Ethan Furman added the comment: Is there a better place, then, than test_cmd_line_script? The entire purpose of PEP 409 is to allow the suppression of non-relevant information in the exception traceback. As such I would expect every Python interpreter to adhere to it. (Yes, I understand

[issue14136] Simplify PEP 409 command line test and move it to test_cmd_line_script

2012-02-28 Thread Ethan Furman
Ethan Furman added the comment: I guess the crux of the issue for me is that I'm trying to test interpreter output, and the fact that I am using a command-line script to do so is an implementation detail. -- ___ Python tracker

[issue14136] Simplify PEP 409 command line test and move it to test_cmd_line_script

2012-02-28 Thread Ethan Furman
Ethan Furman added the comment: Moved to test_cmd_line_script. -- Added file: http://bugs.python.org/file24672/raise_from_none_test_cleanup.diff ___ Python tracker <http://bugs.python.org/issue14

[issue14136] Simplify PEP 409 command line test and move it to test_cmd_line_script

2012-02-28 Thread Ethan Furman
Ethan Furman added the comment: Nick, Thank you for your thorough answers. I'm not trying to be difficult, just trying to learn and understand. -- ___ Python tracker <http://bugs.python.org/is

[issue14399] zipfile and creat/update comment

2012-03-27 Thread Ethan Furman
Ethan Furman added the comment: I see a comment around line 240 that says: # It is assumed that the "end of central directory" magic # number does not appear in the comment. Any reason not to add that check to comment.setter? -- nosy:

[issue14136] Simplify PEP 409 command line test and move it to test_cmd_line_script

2012-03-27 Thread Ethan Furman
Ethan Furman added the comment: Nick Coghlan wrote: > Nick Coghlan added the comment: > > Hah, I've been dealing with Python's regression test suite for 8+ years and > there are still cases where I don't understand the rationale for testing > things a partic

[issue14136] Simplify PEP 409 command line test and move it to test_cmd_line_script

2012-03-27 Thread Ethan Furman
Ethan Furman added the comment: Modified test name to test_pep_409_verbiage(); modified test body to use same pattern as other tests, thus eliminating the dangling test script files after the test was run. -- Added file: http://bugs.python.org/file25052/raise_from_none_test_cleanup_3

[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

[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/cpyt

[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

[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

[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-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 t

[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

[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.

[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/cpyt

[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

[issue30616] Cannot use functional API to create enum with zero values

2017-06-21 Thread Ethan Furman
Ethan Furman added the comment: New changeset dcc8ce44c74492670e6bfbde588a2acbf8f365e0 by ethanfurman (Dong-hee Na) in branch 'master': bpo-30616: Functional API of enum allows to create empty enums. (#2304) https://github.com/python/cpython/commit/dcc8ce44c74492670e6bfbde588a2a

[issue30616] Cannot use functional API to create enum with zero values

2017-06-21 Thread Ethan Furman
Ethan Furman added the comment: 3.7 fixed, now need 3.6. -- stage: test needed -> backport needed ___ Python tracker <http://bugs.python.org/issue30616> ___ _

[issue30616] Cannot use functional API to create enum with zero values

2017-06-24 Thread Ethan Furman
Ethan Furman added the comment: New changeset 504b95047a8ada06ab630abce55ac2f85566ca37 by ethanfurman (Dong-hee Na) in branch '3.6': [3.6] bpo-30616: Functional API of enum allows to create empty enums. (#2304) (#2324) https://github.com/python/cpyt

[issue31085] Add option for namedtuple to name its result type automatically

2017-07-30 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: +ethan.furman ___ Python tracker <http://bugs.python.org/issue31085> ___ ___ Python-bugs-list mailing list Unsubscribe:

[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/34ae04f74dcf4ac97d07c3e82eaf8f

[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` ad

[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: 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
Change by Ethan Furman : -- pull_requests: -11107 ___ Python tracker <https://bugs.python.org/issue35717> ___ ___ Python-bugs-list mailing list Unsubscribe:

[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

[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.py

[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

[issue29752] Enum._missing_ not called for __getattr__ failures

2017-03-07 Thread Ethan Furman
New submission from Ethan Furman: class Label(Enum): RedApple = 1 GreenApple = 2 @classmethod def _missing_(cls, name): for member in cls: if member.name.lower() == name.lower(): return member Currently, _missing_ is only called when using

[issue29752] Enum._missing_ not called for __getattr__ failures

2017-03-09 Thread Ethan Furman
Ethan Furman added the comment: Thank you, Josh, that's a very good point. One can be expected to have the correct spelling when using attribute access. So the two accesses that make sense for a _missing_ call would then be: - by-value lookup (e.g. Label(1)) - by-name lookup (e.g.

[issue29776] Modernize properties

2017-03-09 Thread Ethan Furman
Ethan Furman added the comment: Have you made sure nothing calls the replaced functions manually? Such as: ... self._set_foo(9) ... -- nosy: +ethan.furman ___ Python tracker <http://bugs.python.org/issue29

[issue28856] %b format for bytes does not support objects that follow the buffer protocol

2017-03-13 Thread Ethan Furman
Ethan Furman added the comment: I suspect it was a simple oversight, and should be added now. Since it's been missing for so long I think we should put it in 3.7, maybe put it in 3.6 (maybe not, since it has two point releases out now), but definitely not i

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

2017-06-02 Thread Ethan Furman
Ethan Furman added the comment: Two points: - Python 2.7 was the version marked, but 2.7 does not come with Enum (wasn't introduced until 3.4 -- the third-party backport does work on 2.7) - the problem in the SO question is not caused by Enum, but by re-importing a module un

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

2017-06-02 Thread Ethan Furman
Ethan Furman added the comment: If your example code is the same as the code in the SO problem, then my previous points stand. According to the plain-English description you provided the comparison would succeed, so if you have example code which: - doesn't involve ModuleA being the __m

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

2017-06-08 Thread Ethan Furman
Ethan Furman added the comment: No test code has been provided, so lacking any evidence of this problem I am closing this issue. Do not reopen without testable code to show the failure. -- resolution: -> not a bug stage: test needed -> resolved status: open -&g

[issue29237] Create enum for pstats sorting options

2017-06-08 Thread Ethan Furman
Ethan Furman added the comment: Marriatta, perhaps it is time to let Ratnadeep work on this issue? -- ___ Python tracker <http://bugs.python.org/issue29

[issue30616] Cannot use functional API to create enum with zero values

2017-06-09 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: +ethan.furman ___ Python tracker <http://bugs.python.org/issue30616> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue30616] Cannot use functional API to create enum with zero values

2017-06-09 Thread Ethan Furman
Changes by Ethan Furman : -- assignee: -> ethan.furman components: +Library (Lib) priority: normal -> low stage: -> test needed versions: +Python 3.7 ___ Python tracker <http://bugs.python.or

[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

[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 t

[issue29752] Enum._missing_ not called for __getitem__ failures

2018-01-18 Thread Ethan Furman
Ethan Furman added the comment: To move this forward: The proposal is to add support for a new method, _missing_name_, which is called by __getitem__. If such a method does not exist, the normal AttributeError exception is raised; otherwise, the _missing_name_ method is called with the

[issue32218] add __iter__ to enum.Flag members

2018-01-18 Thread Ethan Furman
Change by Ethan Furman : -- assignee: -> ethan.furman stage: -> needs patch ___ Python tracker <https://bugs.python.org/issue32218> ___ ___ Python-bugs-

[issue31801] vars() manipulation encounters problems with Enum

2018-01-18 Thread Ethan Furman
Change by Ethan Furman : -- stage: test needed -> needs patch ___ Python tracker <https://bugs.python.org/issue31801> ___ ___ Python-bugs-list mailing list Un

[issue31801] vars() manipulation encounters problems with Enum

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

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