We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 16f39bd commit 2dc6453Copy full SHA for 2dc6453
Doc/whatsnew/3.15.rst
@@ -375,10 +375,18 @@ zlib
375
Optimizations
376
=============
377
378
-module_name
379
------------
+abc
+---
380
+
381
+* Reduce memory usage of `issubclass` checks for classes inheriting abstract classes.
382
383
+ :class:`abc.ABCMeta` hook ``__subclasscheck__`` now includes
384
+ a guard which is triggered then the hook is called from a parent class
385
+ (``issubclass(cls, RootClass)`` -> ``issubclass(cls, NestedClass)`` -> ...).
386
+ This guard prevents adding ``cls`` to ``NestedClass`` positive and negative caches,
387
+ preventing memory bloat in some cases (thousands of classes inherited from ABC).
388
-* TODO
389
+ (Contributed by Maxim Martynov in :gh:`92810`.)
390
391
392
0 commit comments