Skip to content

Commit

Permalink
pythongh-124520: What's New entry for ctypes metaclass __new__/__init…
Browse files Browse the repository at this point in the history
…__ change (pythonGH-124546)
  • Loading branch information
encukou authored Sep 27, 2024
1 parent d8cf587 commit 3387f76
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Doc/whatsnew/3.13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
---

Expand Down

0 comments on commit 3387f76

Please sign in to comment.