[issue42674] __init_subclass__ only called for first subclass when class has multiple inheritance

2020-12-24 Thread Ethan Furman
New submission from Ethan Furman : The two subclasses in the test script are not calling super(). When they do, both __init_subclasses__ are called. -- nosy: +ethan.furman resolution: -> not a bug stage: -> resolved status: open -&g

[issue42727] [Enum] EnumMeta.__prepare__ needs to accept **kwds

2020-12-24 Thread Ethan Furman
Change by Ethan Furman : -- pull_requests: +22778 pull_request: https://github.com/python/cpython/pull/23927 ___ Python tracker <https://bugs.python.org/issue42

[issue42727] [Enum] EnumMeta.__prepare__ needs to accept **kwds

2020-12-24 Thread Ethan Furman
Ethan Furman added the comment: New changeset 786d97a66cac48e7a933010367b8993a5b3ab85b by Ethan Furman in branch 'master': bpo-42727: [Enum] use super() and include **kwds (GH-23927) https://github.com/python/cpython/commit/786d97a66cac48e7a933010367b899

[issue42727] [Enum] EnumMeta.__prepare__ needs to accept **kwds

2020-12-25 Thread Ethan Furman
Change by Ethan Furman : -- pull_requests: -22792 ___ Python tracker <https://bugs.python.org/issue42727> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35815] Able to instantiate a subclass with abstract methods from __init_subclass__ of the ABC

2020-12-28 Thread Ethan Furman
Ethan Furman added the comment: If the patch in issue42775 is committed, this problem will be solved. -- assignee: -> ethan.furman superseder: -> __init_subclass__ should be called in __init__ ___ Python tracker <https://bugs.p

[issue42775] __init_subclass__ should be called in __init__

2020-12-28 Thread Ethan Furman
New submission from Ethan Furman : PEP 487 introduced __init_subclass__ and __set_name__, and both of those were wins for the common cases of metaclass usage. Unfortunately, the implementation of PEP 487 with regards to __init_subclass__ has made the writing of correct metaclasses

[issue42775] __init_subclass__ should be called in __init__

2020-12-28 Thread Ethan Furman
Ethan Furman added the comment: My understanding of using keywords in class headers class MyClass(SomeBaseClass, setting='maybe'): ... is that the keywords would get passed into the super classes `__init_subclass__` (`SomeBaseClass` and `setting`). However, in th

[issue42775] __init_subclass__ should be called in __init__

2020-12-28 Thread Ethan Furman
Change by Ethan Furman : -- nosy: +ncoghlan ___ Python tracker <https://bugs.python.org/issue42775> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42775] __init_subclass__ should be called in __init__

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

[issue42775] __init_subclass__ should be called in __init__

2020-12-28 Thread Ethan Furman
Ethan Furman added the comment: Guido, I just wanted to get it all in place while it was fresh in my mind. Actual code tends to make a discussion easier. I'll make sure and transcribe any relevant discussion from python-dev to

[issue42851] Subclassing Enum with ipaddress.IPv4Network/IPv6Network raises TypeError.

2021-01-07 Thread Ethan Furman
Ethan Furman added the comment: That would be due to some changes to try and get `Enum` and `__init_subclass__` to work together. I'll revert those changes. Thank you for the report. -- assignee: -> ethan.furman priority: normal

[issue42851] Subclassing Enum with ipaddress.IPv4Network/IPv6Network raises TypeError.

2021-01-07 Thread Ethan Furman
Change by Ethan Furman : -- keywords: +patch pull_requests: +22982 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24154 ___ Python tracker <https://bugs.python.org/issu

[issue42851] Subclassing Enum with ipaddress.IPv4Network/IPv6Network raises TypeError.

2021-01-07 Thread Ethan Furman
Ethan Furman added the comment: New changeset a581a868d97f649aedf868a1d27865a10925c73a by Ethan Furman in branch 'master': bpo-42851: [Enum] remove brittle __init_subclass__ support (GH-24154) https://github.com/python/cpython/commit/a581a868d97f649aedf868a1d27865

[issue42851] Subclassing Enum with ipaddress.IPv4Network/IPv6Network raises TypeError.

2021-01-07 Thread Ethan Furman
Change by Ethan Furman : -- pull_requests: +22983 pull_request: https://github.com/python/cpython/pull/24155 ___ Python tracker <https://bugs.python.org/issue42

[issue42851] Subclassing Enum with ipaddress.IPv4Network/IPv6Network raises TypeError.

2021-01-07 Thread Ethan Furman
Ethan Furman added the comment: New changeset 9ab4dd452287169f08a8cf4d4c68c2139f8de714 by Ethan Furman in branch '3.9': [3.9] bpo-42851: [Enum] remove brittle __init_subclass__ support (GH-24154) (GH-24155) https://github.com/python/cpython/commit/9ab4dd452287169f08a8cf4d4c68c2

[issue42851] Subclassing Enum with ipaddress.IPv4Network/IPv6Network raises TypeError.

2021-01-08 Thread Ethan Furman
Change by Ethan Furman : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.9 ___ Python tracker <https://bugs.python.or

[issue42901] [Enum] move member creation to __set_name__ in order to support __init_subclass__

2021-01-11 Thread Ethan Furman
New submission from Ethan Furman : In discussions about moving the calls to `__set_name__` and `__init_subclass__`, Nick Coughlan made an observation: Nick Coghlan: > Both EnumMeta and ABCMeta should probably be relying on `__set_name__` > for their per-member set up work these days,

[issue42775] __init_subclass__ should be called in __init__

2021-01-11 Thread Ethan Furman
Ethan Furman added the comment: Nick Coghlan made the observation that `__set_name__` should be doing what is currently the after-new work. Tracking in #42901. -- keywords: -patch resolution: -> rejected stage: patch review -> resolved status: open -> closed superseder:

[issue42901] [Enum] move member creation to __set_name__ in order to support __init_subclass__

2021-01-11 Thread Ethan Furman
Change by Ethan Furman : -- keywords: +patch pull_requests: +23022 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/24196 ___ Python tracker <https://bugs.python.org/issu

[issue42899] Is it legal to eliminate tests of a value, when that test has no effect on control flow?

2021-01-12 Thread Ethan Furman
Ethan Furman added the comment: If an optimization changes semantics it's not an optimization. In `if x: pass` how do we know `x` is falsely without calling `bool()` on it? --- On a slightly different note, in the code: if a and b: ... why is `bool(a)` called

[issue42915] enum.Flag ~ bitwise negation is very slow and can't be defined as a Flag value

2021-01-12 Thread Ethan Furman
Ethan Furman added the comment: I just finished a rewrite of Flag for 3.10. Using your test below I was able to tweak the rewrite so the final numbers are: Took normal 0.148092 seconds. Took cached 0.017438 seconds. Your original post had a ratio of nearly 200 -- it is now 8.7ish

[issue42901] [Enum] move member creation to __set_name__ in order to support __init_subclass__

2021-01-12 Thread Ethan Furman
Ethan Furman added the comment: New changeset c314e60388282d9829762fb6c30b12e2807caa19 by Ethan Furman in branch 'master': bpo-42901: [Enum] move member creation to `__set_name__` (GH-24196) https://github.com/python/cpython/commit/c314e60388282d9829762fb6c30b12

[issue42915] enum.Flag ~ bitwise negation is very slow and can't be defined as a Flag value

2021-01-13 Thread Ethan Furman
Ethan Furman added the comment: Yes. -- ___ Python tracker <https://bugs.python.org/issue42915> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue32218] add __iter__ to enum.Flag members

2021-01-13 Thread Ethan Furman
Ethan Furman added the comment: Final outcome: `Flag` has been redesigned such that any flag comprised of a single bit is canonical; flags comprised of multiple bits are considered aliases. During iteration only canonical flags are returned. -- resolution: -> fixed stage: pa

[issue38250] enum.Flag should be more set-like

2021-01-13 Thread Ethan Furman
Change by Ethan Furman : -- pull_requests: +23042 pull_request: https://github.com/python/cpython/pull/24215 ___ Python tracker <https://bugs.python.org/issue38

[issue38250] enum.Flag should be more set-like

2021-01-13 Thread Ethan Furman
Ethan Furman added the comment: The code sample: class Color(IntFlag): BLACK = 0 RED = 1 GREEN = 2 BLUE = 4 PURPLE = RED | BLUE WHITE = RED | GREEN | BLUE Here's the summary of the changes: - single-bit flags are canonical - multi-bi

[issue42953] After the subclass of enum.Enum is imported in some diffenent ways, the same enumeration value is judged as False

2021-01-18 Thread Ethan Furman
Ethan Furman added the comment: This issue is not unique to Enum, and is not an Enum problem. What is happening is that "test.py" has the `__name__` of `__main__` because it is being directly executed from the command line, but when `test2.py` imports it, it is being re-ex

[issue38250] enum.Flag should be more set-like

2021-01-25 Thread Ethan Furman
Ethan Furman added the comment: New changeset 7aaeb2a3d682ecba125c33511e4b4796021d2f82 by Ethan Furman in branch 'master': bpo-38250: [Enum] single-bit flags are canonical (GH-24215) https://github.com/python/cpython/commit/7aaeb2a3d682ecba125c33511e4b47

[issue38250] enum.Flag should be more set-like

2021-01-25 Thread Ethan Furman
Ethan Furman added the comment: Thank you to everyone involved. :-) To answer the first three points that started this issue: 1. iteration -> each single-bit flag in the entire flag, or a combinations of flags, is returned one at a time -- not the empty set, not other multi-bit val

[issue42915] enum.Flag ~ bitwise negation is very slow and can't be defined as a Flag value

2021-01-25 Thread Ethan Furman
Ethan Furman added the comment: Fixed in 3.10 in issue38250. Also fixed in my 3rd-party library, aenum 3.0: (https://pypi.org/project/aenum/) -- resolution: -> wont fix stage: -> resolved status: open -> closed superseder: -> enum.Flag should be more s

[issue42901] [Enum] move member creation to __set_name__ in order to support __init_subclass__

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

[issue38250] enum.Flag should be more set-like

2021-01-26 Thread Ethan Furman
Change by Ethan Furman : -- pull_requests: +23161 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/24342 ___ Python tracker <https://bugs.python.org/issu

[issue38250] enum.Flag should be more set-like

2021-01-26 Thread Ethan Furman
Ethan Furman added the comment: New changeset 01faf4542a8652adfbd3b3f897ba718e8ce43f5e by Ethan Furman in branch 'master': bpo-38250: [Enum] only include .rst test if file available (GH-24342) https://github.com/python/cpython/commit/01faf4542a8652adfbd3b3f897ba71

[issue35815] Able to instantiate a subclass with abstract methods from __init_subclass__ of the ABC

2021-02-01 Thread Ethan Furman
Ethan Furman added the comment: That patch was reject in favor of updating Enum to use `__set_name__` to do the final creation of enum members. The same thing could be done for ABC, but I lack the C skills to make it happen. -- assignee: ethan.furman -> superse

[issue35815] Able to instantiate a subclass with abstract methods from __init_subclass__ of the ABC

2021-02-01 Thread Ethan Furman
Change by Ethan Furman : -- Removed message: https://bugs.python.org/msg386099 ___ Python tracker <https://bugs.python.org/issue35815> ___ ___ Python-bugs-list m

[issue35815] Able to instantiate a subclass with abstract methods from __init_subclass__ of the ABC

2021-02-01 Thread Ethan Furman
Ethan Furman added the comment: That patch was rejected in favor of updating Enum to use `__set_name__` to do the final creation of enum members. The same thing could be done for ABC, but I lack the C skills to make it happen. -- ___ Python

[issue42727] [Enum] EnumMeta.__prepare__ needs to accept **kwds

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

[issue40042] Enum Flag: psuedo-members have None for name attribute

2021-02-01 Thread Ethan Furman
Ethan Furman added the comment: This issue is fixed in #38250. -- resolution: -> fixed stage: needs patch -> resolved status: open -> closed superseder: -> enum.Flag should be more set-like ___ Python tracker <https://bugs.python

[issue8264] [doc] hasattr doesn't show private (double underscore) attributes exist

2021-02-02 Thread Ethan Furman
Ethan Furman added the comment: New changeset 2edaf6a4fb7e20324dde1423232f07211347f092 by Ken Jin in branch 'master': bpo-8264: Document hasattr and getattr behavior for private attributes (GH-23513) https://github.com/python/cpython/commit/2edaf6a4fb7e20324dde1423232f07

[issue43162] Enum regression: AttributeError when accessing class variables on instances

2021-02-08 Thread Ethan Furman
Ethan Furman added the comment: The code for that `__str__` seems very inefficient -- why doesn't it just do: return self.name ? - The issue is not being able to access class attributes, the issue is whether one enum member should be seen as an attribute of an

[issue43162] Enum regression: AttributeError when accessing class variables on instances

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

[issue43162] Enum regression: AttributeError when accessing class variables on instances

2021-02-08 Thread Ethan Furman
Ethan Furman added the comment: New changeset d65b9033d6d092552775f6f5e41e7647100f9f2c by Ethan Furman in branch 'master': bpo-43162: [Enum] deprecate enum member.member access (GH-24486) https://github.com/python/cpython/commit/d65b9033d6d092552775f6f5e41e76

[issue43162] Enum regression: AttributeError when accessing class variables on instances

2021-02-08 Thread Ethan Furman
Ethan Furman added the comment: Dylan, it's not the `from_str()` method, but the `__str__` method that is the problem. Instead of def __str__(self): if self is self.EXITCODE: return 'exitcode' it should be def __str__(self): cls =

[issue43162] Enum regression: AttributeError when accessing class variables on instances

2021-02-08 Thread Ethan Furman
Change by Ethan Furman : -- pull_requests: +23277 pull_request: https://github.com/python/cpython/pull/24487 ___ Python tracker <https://bugs.python.org/issue43

[issue43098] tarfile list() method does not show file type

2021-02-23 Thread Ethan Furman
Change by Ethan Furman : -- assignee: -> ethan.furman nosy: +ethan.furman ___ Python tracker <https://bugs.python.org/issue43098> ___ ___ Python-bugs-list mai

[issue43162] Enum regression: AttributeError when accessing class variables on instances

2021-03-02 Thread Ethan Furman
Ethan Furman added the comment: DeprecationWarning will be active in 3.10 and 3.11 with removal in 3.12. -- ___ Python tracker <https://bugs.python.org/issue43

[issue43162] Enum regression: AttributeError when accessing class variables on instances

2021-03-03 Thread Ethan Furman
Ethan Furman added the comment: New changeset 44e580f448016b86807465a186d03d9074e2b589 by Ethan Furman in branch 'master': bpo-43162: [Enum] update docs, renable doc tests (GH-24487) https://github.com/python/cpython/commit/44e580f448016b86807465a186d03d

[issue43162] Enum regression: AttributeError when accessing class variables on instances

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

[issue43162] Enum regression: AttributeError when accessing class variables on instances

2021-03-03 Thread Ethan Furman
Ethan Furman added the comment: You're welcome. Thank you for pushing the issue! :-) -- ___ Python tracker <https://bugs.python.org/issue43162> ___ ___

[issue43430] Exception raised when attempting to create Enum via functional API

2021-03-07 Thread Ethan Furman
Change by Ethan Furman : -- assignee: -> ethan.furman ___ Python tracker <https://bugs.python.org/issue43430> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue40025] enum: _generate_next_value_ is not called if its definition occurs after calls to auto()

2020-05-27 Thread Ethan Furman
Ethan Furman added the comment: New changeset b5ecbf02e4dbdea6d1c9a6d7189137f76e70c073 by Miss Islington (bot) in branch '3.8': bpo-40025: Require _generate_next_value_ to be defined before members(GH-19763) https://github.com/python/cpython/commit/b5ecbf02e4dbdea6d1c9a6d7189137

[issue40025] enum: _generate_next_value_ is not called if its definition occurs after calls to auto()

2020-06-11 Thread Ethan Furman
Ethan Furman added the comment: New changeset ebd44003c9e206755e5e28716242ed8941495a62 by Miss Islington (bot) in branch '3.7': bpo-40025: Require _generate_next_value_ to be defined before members (GH-19762) https://github.com/python/cpython/commit/ebd44003c9e206755e5e28716242ed

[issue40025] enum: _generate_next_value_ is not called if its definition occurs after calls to auto()

2020-06-21 Thread Ethan Furman
Ethan Furman added the comment: Not yet. I want to investigate the idea Ankesh Saha had some more. -- versions: +Python 3.10 -Python 3.7, Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python.org/issue40

[issue41139] cgi uses the locale encoding for log files

2020-07-02 Thread Ethan Furman
Ethan Furman added the comment: Which functionality? - cgi.log() - opening with current locale I don't mind keeping the function, but if the file isn't already opened I think using UTF-8 is an appropriate choice. -- ___ Python track

[issue39017] Infinite loop in the tarfile module

2020-07-10 Thread Ethan Furman
Ethan Furman added the comment: Absolutely! But first, you'll need to sign the Contributor License Agreement: https://www.python.org/psf/contrib/contrib-form/ Thank you for your help! -- ___ Python tracker <https://bugs.python.org/is

[issue41517] Enum multiple inheritance loophole

2020-08-10 Thread Ethan Furman
Ethan Furman added the comment: The problem is that class B should raise an error as class A already has members. -- ___ Python tracker <https://bugs.python.org/issue41

[issue39461] [RFE] os.environ should support Path-like values, like subprocess(..., env=...)

2020-08-31 Thread Ethan Furman
Change by Ethan Furman : -- resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue39461> ___ ___

[issue32218] add __iter__ to enum.Flag members

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

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

2020-09-12 Thread Ethan Furman
Ethan Furman added the comment: Antony, My apologies for the delay. What I would like to see is a real example of how you would use this new feature if it were implemented. I'm guessing it would look something like: class MyEnum(Enum): locals.update(*some magic

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

2020-09-12 Thread Ethan Furman
Ethan Furman added the comment: Guido, do you have an opinion on adding `RegexFlag` to the `re` module's `__all__` and documenting it? There is also some discussion on making these types of int-to-Enum conversions use a `module.name` repr instead of `class.name`: used to be: >

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

2020-09-13 Thread Ethan Furman
Change by Ethan Furman : -- pull_requests: +21282 pull_request: https://github.com/python/cpython/pull/7 ___ Python tracker <https://bugs.python.org/issue37

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

2020-09-13 Thread Ethan Furman
Change by Ethan Furman : -- pull_requests: +21283 pull_request: https://github.com/python/cpython/pull/8 ___ Python tracker <https://bugs.python.org/issue37

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

2020-09-13 Thread Ethan Furman
Ethan Furman added the comment: Thank you, Rubén, for the patch. Thank you, Karthikeyan, for not making me backport it. :-) -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10 -P

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

2020-09-13 Thread Ethan Furman
Ethan Furman added the comment: New changeset 38c8d3930eb872258a82339bcba3bce1d0e3ac2c by Ethan Furman in branch '3.8': [3.8] bpo-37479: Enum - use correct __format__ (GH-14545) https://github.com/python/cpython/commit/38c8d3930eb872258a82339bcba3bc

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

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

[issue40721] PEP0435 (enums) -- there is no standard on enum item letters case

2020-09-13 Thread Ethan Furman
Ethan Furman added the comment: For Python code at least, Guido has proclaimed: https://mail.python.org/pipermail/python-ideas/2016-September/042340.html I recommend naming all enums UPPER_CASE. They're constants (within a namespace) and that's the rule for constants. It's

[issue40721] PEP0435 (enums) -- there is no standard on enum item letters case

2020-09-13 Thread Ethan Furman
Change by Ethan Furman : -- keywords: +patch pull_requests: +21286 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22231 ___ 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-14 Thread Ethan Furman
Ethan Furman added the comment: Looks like the `re` module's flags have been updated separately in issue36548: >>> import re >>> re.I re.IGNORECASE >>> print(re.I) # should also be re.IGNORECASE >>> re.I|re.S|re.X re.IGNORECA

[issue40721] PEP0435 (enums) -- there is no standard on enum item letters case

2020-09-14 Thread Ethan Furman
Ethan Furman added the comment: New changeset 542e1df2b018ee7068dba8076f2d6e84efd6e144 by Ethan Furman in branch 'master': bpo-40721: add note about enum member name case (GH-22231) https://github.com/python/cpython/commit/542e1df2b018ee7068dba8076f2d6e

[issue40721] PEP0435 (enums) -- there is no standard on enum item letters case

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

[issue39451] enum.Enum reference count leaks

2020-09-14 Thread Ethan Furman
Ethan Furman added the comment: Thanks, Dan, for checking this out. As you noted, a garbage collection solved the issue, so I'm not going to worry about it. -- resolution: -> not a bug stage: -> resolved status: open -> closed

[issue41541] [PATCH] Make pty.spawn set window size

2020-09-14 Thread Ethan Furman
Change by Ethan Furman : -- nosy: +ethan.furman ___ Python tracker <https://bugs.python.org/issue41541> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue41786] re.RegexFlag.__str__ is incorrect

2020-09-14 Thread Ethan Furman
New submission from Ethan Furman : In issue36548 - Make the repr of re flags more readable - __str__ is set to object.__str__. Hovewer, setting __str__ to object.__str__ means that EnumMeta will replace __str__ with the first Enum's __str__ instead (Flag, in this case). As ask

[issue41786] re.RegexFlag.__str__ is incorrect

2020-09-14 Thread Ethan Furman
Ethan Furman added the comment: >>> import re >>> re.I re.IGNORECASE >>> print(re.I) RegexFlag.IGNORECASE# according to comment in linked issue, this should be `re.IGNORECASE` as well -- ___ Python tracker <http

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

2020-09-14 Thread Ethan Furman
Ethan Furman added the comment: "repr as inverse of eval" is nice to have, but it is not a requirement. -- ___ Python tracker <https://bugs.python.o

[issue41517] Able to subclass enum with members by using multiple inheritance

2020-09-14 Thread Ethan Furman
Ethan Furman added the comment: To answer the invariant question, see this post by Guido: https://mail.python.org/pipermail/python-dev/2013-April/125716.html -- ___ Python tracker <https://bugs.python.org/issue41

[issue41789] Enum: __str__ and friends sometimes erroneously replaced

2020-09-14 Thread Ethan Furman
New submission from Ethan Furman : If an Enum declares __str__, __repr__, __format__, or __reduce_ex__ to be object`s, then it will get replaced by the base Enum's corresponding method. E.g.: class RegexFlag(IntFlag): IGNORECASE = I = 2 def repr(self): return &

[issue41786] re.RegexFlag.__str__ is incorrect

2020-09-14 Thread Ethan Furman
Ethan Furman added the comment: The behavior of not honoring the object.__str__ override is a bug in Enum and currently being tracked in issue41789. -- resolution: -> duplicate stage: needs patch -> resolved status: open -> closed superseder: -> Enum: __str__ and frien

[issue41789] Enum: __str__ and friends sometimes erroneously replaced

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

[issue39587] Mixin repr overrides Enum repr in some cases

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

[issue39587] Mixin repr overrides Enum repr in some cases

2020-09-15 Thread Ethan Furman
Change by Ethan Furman : -- versions: +Python 3.10, Python 3.9 -Python 3.7 ___ Python tracker <https://bugs.python.org/issue39587> ___ ___ Python-bugs-list mailin

[issue39587] Mixin repr overrides Enum repr in some cases

2020-09-15 Thread Ethan Furman
Ethan Furman added the comment: Yes, the change only considered types with their own copy of `__new__` to be actual data types, so in 3.6 `HexInt` was the recognized data type, but in 3.7+ it was `int` -- which also meant that HexEnum was considered a simple mix-in and its `__repr__` was

[issue39587] Mixin repr overrides Enum repr in some cases

2020-09-15 Thread Ethan Furman
Ethan Furman added the comment: New changeset bff01f3a3aac0c15fe8fbe8b2f561f7927d117a1 by Ethan Furman in branch 'master': bpo-39587: Enum - use correct mixed-in data type (GH-22263) https://github.com/python/cpython/commit/bff01f3a3aac0c15fe8fbe8b2f561f

[issue39587] Mixin repr overrides Enum repr in some cases

2020-09-15 Thread Ethan Furman
Ethan Furman added the comment: New changeset 95b81e2f8c955823dbf5632a817902b8a4916eaa by Miss Islington (bot) in branch '3.9': bpo-39587: Enum - use correct mixed-in data type (GH-22263) (GH-22266) https://github.com/python/cpython/commit/95b81e2f8c955823dbf5632a817902

[issue39587] Mixin repr overrides Enum repr in some cases

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

[issue41517] Able to subclass enum with members by using multiple inheritance

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

[issue41789] Enum: __str__ and friends sometimes erroneously replaced

2020-09-15 Thread Ethan Furman
Change by Ethan Furman : -- pull_requests: +21327 pull_request: https://github.com/python/cpython/pull/22272 ___ Python tracker <https://bugs.python.org/issue41

[issue41517] Able to subclass enum with members by using multiple inheritance

2020-09-15 Thread Ethan Furman
Change by Ethan Furman : -- versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.7 ___ Python tracker <https://bugs.python.org/issue41517> ___ ___ Python-bug

[issue41789] Enum: __str__ and friends sometimes erroneously replaced

2020-09-16 Thread Ethan Furman
Ethan Furman added the comment: New changeset a4677068dd61662f5a56b184d5e3aa07db65b88e by Ethan Furman in branch '3.9': [3.9] bpo-41789: honor object overrides in Enum classes (GH-22250) (GH-22272) https://github.com/python/cpython/commit/a4677068dd61662f5a56b184d5e3aa

[issue41789] Enum: __str__ and friends sometimes erroneously replaced

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

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

2020-09-16 Thread Ethan Furman
Change by Ethan Furman : -- versions: +Python 3.10 ___ Python tracker <https://bugs.python.org/issue39728> ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2020-09-16 Thread Ethan Furman
Change by Ethan Furman : -- pull_requests: +21330 pull_request: https://github.com/python/cpython/pull/22277 ___ Python tracker <https://bugs.python.org/issue39

[issue41517] Able to subclass enum with members by using multiple inheritance

2020-09-16 Thread Ethan Furman
Ethan Furman added the comment: New changeset 3064dbf5df1021e85b507366a7ea448c8895efe7 by Ethan Furman in branch 'master': bpo-41517: do not allow Enums to be extended (#22271) https://github.com/python/cpython/commit/3064dbf5df1021e85b507366a7ea44

[issue41517] Able to subclass enum with members by using multiple inheritance

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

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

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

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

2020-09-16 Thread Ethan Furman
Change by Ethan Furman : -- pull_requests: +21334 pull_request: https://github.com/python/cpython/pull/22282 ___ Python tracker <https://bugs.python.org/issue39

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

2020-09-16 Thread Ethan Furman
Change by Ethan Furman : -- pull_requests: +21335 pull_request: https://github.com/python/cpython/pull/22283 ___ Python tracker <https://bugs.python.org/issue39

[issue40025] enum: _generate_next_value_ is not called if its definition occurs after calls to auto()

2020-09-16 Thread Ethan Furman
Change by Ethan Furman : -- pull_requests: +21336 pull_request: https://github.com/python/cpython/pull/22284 ___ Python tracker <https://bugs.python.org/issue40

[issue40025] enum: _generate_next_value_ is not called if its definition occurs after calls to auto()

2020-09-16 Thread Ethan Furman
Change by Ethan Furman : -- pull_requests: +21337 pull_request: https://github.com/python/cpython/pull/22285 ___ Python tracker <https://bugs.python.org/issue40

[issue40025] enum: _generate_next_value_ is not called if its definition occurs after calls to auto()

2020-09-16 Thread Ethan Furman
Ethan Furman added the comment: There was an effort to make it so `_generate_next_value_` could be defined last and still work correctly -- unfortunately, it could not handle the more common case of using `auto()` with the default `_generate_next_value_`: class I(Enum): first = auto

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