[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

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

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

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

[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

[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

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

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

[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

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

[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

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

[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

[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/9ab4dd452287169f08a8cf4d4c68c2139f8de714

[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 a581a868d97f649aedf868a1d27865a10925c73a by Ethan Furman in branch 'master': bpo-42851: [Enum] remove brittle __init_subclass__ support (GH-24154) https://github.com/python/cpython/commit/a581a868d97f649aedf868a1d27865a10925c73a

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

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

[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
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
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 the cases

[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

[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

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

[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/786d97a66cac48e7a933010367b8993a5b3ab85b

[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

[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

[issue41644] builtin type kwargs

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

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

2020-12-24 Thread Ethan Furman
Ethan Furman added the comment: New changeset f7dca9b9c864c1b7807014ea21a30cac76727e8b by Ethan Furman in branch '3.9': [3.9] bpo-42727: [Enum] EnumMeta.__prepare__ now accepts **kwds (GH-23917). (GH-23926) https://github.com/python/cpython/commit/f7dca9b9c864c1b7807014ea21a30cac76727e8b

[issue38397] __init_subclass__ causes TypeError when used with more standard library metaclasses (such as EnumMeta)

2020-12-24 Thread Ethan Furman
Ethan Furman added the comment: I just added **kwds to EnumMeta -- can this be closed? -- nosy: +ethan.furman ___ Python tracker <https://bugs.python.org/issue38

[issue32768] object.__new__ does not accept arguments if __bases__ is changed

2020-12-24 Thread Ethan Furman
Ethan Furman added the comment: A use-case for writable bases: __init_subclass__ is called in type.__new__, which means that for Enum __init_subclass__ is called before the members have been added. To work around this I am currently (3.10) adding in a _NoInitSubclass to the bases before

[issue32501] Documentation for dir([object])

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

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

2020-12-24 Thread Ethan Furman
Ethan Furman added the comment: I tried update `abc.py` with the same dance I have to use with `Enum`: def __new__(mcls, name, bases, namespace, **kwargs): # remove current __init_subclass__ so previous one can be found with getattr try: new_init_subclass

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

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

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

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

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

2020-12-23 Thread Ethan Furman
New submission from Ethan Furman : **kwds are necessary to support __init_subclass__, but __prepare__ currently does not accept them. -- assignee: ethan.furman messages: 383670 nosy: ethan.furman priority: normal severity: normal status: open title: [Enum] EnumMeta.__prepare__ needs

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

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

[issue42678] [Enum] _sunder_ methods only looked up in the last Enum class in the mro

2020-12-18 Thread Ethan Furman
Change by Ethan Furman : -- assignee: ethan.furman components: Library (Lib) nosy: ethan.furman priority: normal severity: normal stage: needs patch status: open title: [Enum] _sunder_ methods only looked up in the last Enum class in the mro type: behavior versions: Python 3.10, Python

[issue42567] Enum: manually call __init_subclass__ after members are added

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

[issue42567] Enum: manually call __init_subclass__ after members are added

2020-12-14 Thread Ethan Furman
Ethan Furman added the comment: New changeset 9d1fff1fcd5332f0ba7f72d0e0f9f66b47ec4e8d by Ethan Furman in branch '3.9': [3.9] bpo-42567: [Enum] call __init_subclass__ after members are added (GH-23714) (GH-23772) https://github.com/python/cpython/commit

[issue42567] Enum: manually call __init_subclass__ after members are added

2020-12-14 Thread Ethan Furman
Change by Ethan Furman : -- pull_requests: +22628 stage: backport needed -> patch review pull_request: https://github.com/python/cpython/pull/23772 ___ Python tracker <https://bugs.python.org/issu

[issue40084] HTTPStatus has incomplete dir() listing

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

[issue42517] Enum: do not convert private names into members

2020-12-14 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

[issue42517] Enum: do not convert private names into members

2020-12-14 Thread Ethan Furman
Ethan Furman added the comment: New changeset aba12b67c18b17bb727a0d50dd0653e38cb64dc8 by Miss Islington (bot) in branch '3.9': [3.9] bpo-42517: [Enum] deprecate private name members (GH-23722) (GH-23748) https://github.com/python/cpython/commit/aba12b67c18b17bb727a0d50dd0653e38cb64dc8

[issue39717] Fix exception causes in tarfile module

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

[issue39717] Fix exception causes in tarfile module

2020-12-12 Thread Ethan Furman
Ethan Furman added the comment: New changeset b5a6db9111562454617b6771b61f2734ea0420c9 by Ethan Furman in branch 'master': bpo-39717: [tarfile] update nested exception raising (GH-23739) https://github.com/python/cpython/commit/b5a6db9111562454617b6771b61f2734ea0420c9

[issue39717] Fix exception causes in tarfile module

2020-12-10 Thread Ethan Furman
Change by Ethan Furman : -- versions: +Python 3.10 -Python 3.9 ___ Python tracker <https://bugs.python.org/issue39717> ___ ___ Python-bugs-list mailing list Unsub

[issue39717] Fix exception causes in tarfile module

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

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

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

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

2020-12-10 Thread Ethan Furman
Ethan Furman added the comment: New changeset a65828717982e6a56382d7aff738478f5b5b25d0 by Ethan Furman in branch 'master': bpo-34750: [Enum] add `_EnumDict.update()` support (GH-23725) https://github.com/python/cpython/commit/a65828717982e6a56382d7aff738478f5b5b25d0

[issue42385] adjust enum.auto's behavior for StrEnum to return the enum name

2020-12-10 Thread Ethan Furman
Ethan Furman added the comment: Thank you for finding that, Antony. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue42385] adjust enum.auto's behavior for StrEnum to return the enum name

2020-12-10 Thread Ethan Furman
Ethan Furman added the comment: New changeset efb13be72cbf49edf591936fafb120fe1b7d59f7 by Ethan Furman in branch 'master': bpo-42385: [Enum] add `_generate_next_value_` to StrEnum (GH-23735) https://github.com/python/cpython/commit/efb13be72cbf49edf591936fafb120fe1b7d59f7

[issue42385] adjust enum.auto's behavior for StrEnum to return the enum name

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

[issue42385] adjust enum.auto's behavior for StrEnum to return the enum name

2020-12-10 Thread Ethan Furman
Change by Ethan Furman : -- stage: patch review -> needs patch title: Should enum.auto's behavior be adjusted for StrEnum to return the enum name? -> adjust enum.auto's behavior for StrEnum to return the enum name ___ Python tracker

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

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

[issue42517] Enum: do not convert private names into members

2020-12-09 Thread Ethan Furman
Ethan Furman added the comment: New changeset 7cf0aad96d1d20f07d7f0e374885f327c2d5ff27 by Ethan Furman in branch 'master': bpo-42517: [Enum] do not convert private names into members (GH-23722) https://github.com/python/cpython/commit/7cf0aad96d1d20f07d7f0e374885f327c2d5ff27

[issue42567] Enum: manually call __init_subclass__ after members are added

2020-12-09 Thread Ethan Furman
Change by Ethan Furman : -- stage: patch review -> backport needed versions: +Python 3.9 ___ Python tracker <https://bugs.python.org/issue42567> ___ ___ Py

[issue42567] Enum: manually call __init_subclass__ after members are added

2020-12-09 Thread Ethan Furman
Ethan Furman added the comment: New changeset 6bd94de168b58ac9358277ed6f200490ab26c174 by Ethan Furman in branch 'master': bpo-42567: [Enum] call __init_subclass__ after members are added (GH-23714) https://github.com/python/cpython/commit/6bd94de168b58ac9358277ed6f200490ab26c174

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

2020-12-09 Thread Ethan Furman
Ethan Furman added the comment: Okay, you convinced me. I would ask two things, though: - use vars() instead of locals() - split the one-liner ;) class Foo(Enum): vars().update({ k: v for k, v in foo_defines.items

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

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

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

2020-12-09 Thread Ethan Furman
Change by Ethan Furman : -- stage: -> needs patch type: -> enhancement versions: +Python 3.10 -Python 3.8 ___ Python tracker <https://bugs.python.org/i

[issue40084] HTTPStatus has incomplete dir() listing

2020-12-09 Thread Ethan Furman
Ethan Furman added the comment: New changeset f6d1520219899874d78e7710934c9b21af880f9a by Miss Islington (bot) in branch '3.8': bpo-40084: [Enum] dir() includes member attributes (GH-19219) (GH-22853) https://github.com/python/cpython/commit/f6d1520219899874d78e7710934c9b21af880f9a

[issue42517] Enum: do not convert private names into members

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

[issue42517] Enum: do not convert private names into members

2020-12-09 Thread Ethan Furman
Ethan Furman added the comment: Make that deprecate in 3.9, work correctly in 3.10. -- ___ Python tracker <https://bugs.python.org/issue42517> ___ ___ Python-bug

[issue42567] Enum: manually call __init_subclass__ after members are added

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

[issue41907] Regression in IntFlag behaviour in f-string

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

[issue41907] Regression in IntFlag behaviour in f-string

2020-12-08 Thread Ethan Furman
Ethan Furman added the comment: New changeset cbfcc67170d459bcf3e9d63d2f44eadec740bf69 by Miss Islington (bot) in branch '3.8': bpo-41907: [Enum] fix format() behavior for IntFlag (GH-22497) (GH-23704) https://github.com/python/cpython/commit/cbfcc67170d459bcf3e9d63d2f44eadec740bf69

[issue41907] Regression in IntFlag behaviour in f-string

2020-12-08 Thread Ethan Furman
Ethan Furman added the comment: New changeset 14eaa7d75282d8458455c41e9e871c56db8b9a10 by Miss Islington (bot) in branch '3.9': bpo-41907: [Enum] fix format() behavior for IntFlag (GH-22497) (GH-23703) https://github.com/python/cpython/commit/14eaa7d75282d8458455c41e9e871c56db8b9a10

[issue41907] Regression in IntFlag behaviour in f-string

2020-12-08 Thread Ethan Furman
Ethan Furman added the comment: New changeset 37440eef7f9a0c27e13fc9ce0850574bb00688b0 by Ethan Furman in branch 'master': bpo-41907: [Enum] fix format() behavior for IntFlag (GH-22497) https://github.com/python/cpython/commit/37440eef7f9a0c27e13fc9ce0850574bb00688b0

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

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

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

2020-12-07 Thread Ethan Furman
Ethan Furman added the comment: New changeset be52ca45d9eb9c3e8941e46ddc67a210f0f4c6fa by Miss Islington (bot) in branch '3.9': bpo-41889: [Enum] fix multiple-inheritance regression (GH-22487) (GH-23673) https://github.com/python/cpython/commit/be52ca45d9eb9c3e8941e46ddc67a210f0f4c6fa

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

2020-12-07 Thread Ethan Furman
Ethan Furman added the comment: New changeset 699e5e448919283578afe445069ab93b34bf8eae by Miss Islington (bot) in branch '3.8': bpo-41889: [Enum] fix multiple-inheritance regression (GH-22487) (GH-23672) https://github.com/python/cpython/commit/699e5e448919283578afe445069ab93b34bf8eae

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

2020-12-07 Thread Ethan Furman
Ethan Furman added the comment: New changeset c266736ec1f9ebef38b134ceb4832df015711b38 by Ethan Furman in branch 'master': bpo-41889: [Enum] fix multiple-inheritance regression (GH-22487) https://github.com/python/cpython/commit/c266736ec1f9ebef38b134ceb4832df015711b38

[issue42567] Enum: manually call __init_subclass__ after members are added

2020-12-04 Thread Ethan Furman
New submission from Ethan Furman : __init_subclass__ is being automatically called when the initial Enum is created, but before the members have been added, greatly reducing that method's usefulness. -- assignee: ethan.furman components: Library (Lib) messages: 382489 nosy

[issue42517] Enum: do not convert private names into members

2020-11-30 Thread Ethan Furman
New submission from Ethan Furman : Currently, private names such as '__location' will get both name mangled and converted into an attribute, while `__location_` will get mangled, but not converted as the final name is sundered (e.g. `_MyEnum__location_`). Just in case anyone is actually

[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

[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

[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

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

[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

[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

[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

[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

[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/64362c2e435eddc5e84cea313d92bc0b96d227f7

[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

[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/5acc1b5f0b62eef3258e4bc31eba3b9c659108c9

[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

[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

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

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

[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

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

[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

[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/0063ff4e583505e69473caa978e476ea4c559b83

[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

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