Mailing List Archive

[issue42901] [Enum] move member creation to __set_name__ in order to support __init_subclass__
New submission from Ethan Furman <ethan@stoneleaf.us>:

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, rather than deferring that
> work until after `__new__` returns.

By having `__set_name__` create the final members, they will be in place for the call to `__init_subclass__`.

----------
assignee: ethan.furman
components: Library (Lib)
messages: 384875
nosy: barry, eli.bendersky, ethan.furman
priority: high
severity: normal
stage: needs patch
status: open
title: [Enum] move member creation to __set_name__ in order to support __init_subclass__
type: enhancement
versions: Python 3.10

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue42901>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue42901] [Enum] move member creation to __set_name__ in order to support __init_subclass__ [ In reply to ]
Change by Ethan Furman <ethan@stoneleaf.us>:


----------
keywords: +patch
pull_requests: +23022
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/24196

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue42901>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue42901] [Enum] move member creation to __set_name__ in order to support __init_subclass__ [ In reply to ]
Ethan Furman <ethan@stoneleaf.us> 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


----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue42901>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue42901] [Enum] move member creation to __set_name__ in order to support __init_subclass__ [ In reply to ]
Change by Ethan Furman <ethan@stoneleaf.us>:


----------
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue42901>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue42901] [Enum] move member creation to __set_name__ in order to support __init_subclass__ [ In reply to ]
Miro Hron?ok <miro@hroncok.cz> added the comment:

I found a possible regression: https://bugs.python.org/issue43162

----------
nosy: +hroncok

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue42901>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com