Skip to content

Commit ec4d7b5

Browse files
[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 3387f76) Co-authored-by: Petr Viktorin <[email protected]>
1 parent 09aecb6 commit ec4d7b5

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Doc/whatsnew/3.13.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,24 @@ copy
824824
(Contributed by Serhiy Storchaka in :gh:`108751`.)
825825

826826

827+
ctypes
828+
------
829+
830+
* As a consequence of necessary internal refactoring, initialization of
831+
internal metaclasses now happens in ``__init__`` rather
832+
than in ``__new__``. This affects projects that subclass these internal
833+
metaclasses to provide custom initialization.
834+
Generally:
835+
836+
- Custom logic that was done in ``__new__`` after calling ``super().__new__``
837+
should be moved to ``__init__``.
838+
- To create a class, call the metaclass, not only the metaclass's
839+
``__new__`` method.
840+
841+
See :gh:`124520` for discussion and links to changes in some affected
842+
projects.
843+
844+
827845
dbm
828846
---
829847

0 commit comments

Comments
 (0)