Skip to content

Commit 3387f76

Browse files
authored
gh-124520: What's New entry for ctypes metaclass __new__/__init__ change (GH-124546)
1 parent d8cf587 commit 3387f76

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Doc/whatsnew/3.13.rst

+18
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)