[3.13] gh-124520: What's New entry for ctypes metaclass __new__/__init__ change (GH-124546) (#124708)

gh-124520: What's New entry for ctypes metaclass __new__/__init__ change (GH-124546)
(cherry picked from commit 3387f76b8f)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
This commit is contained in:
Miss Islington (bot) 2024-09-27 23:23:16 +02:00 committed by GitHub
parent 09aecb66df
commit ec4d7b5d22
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 18 additions and 0 deletions

View File

@ -824,6 +824,24 @@ copy
(Contributed by Serhiy Storchaka in :gh:`108751`.)
ctypes
------
* As a consequence of necessary internal refactoring, initialization of
internal metaclasses now happens in ``__init__`` rather
than in ``__new__``. This affects projects that subclass these internal
metaclasses to provide custom initialization.
Generally:
- Custom logic that was done in ``__new__`` after calling ``super().__new__``
should be moved to ``__init__``.
- To create a class, call the metaclass, not only the metaclass's
``__new__`` method.
See :gh:`124520` for discussion and links to changes in some affected
projects.
dbm
---