]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
``importlib/_bootstrap.py``: Reduce size of ``_List`` instances (GH-114747)
authorKirill Podoprigora <kirill.bast9@mail.ru>
Tue, 30 Jan 2024 18:44:09 +0000 (21:44 +0300)
committerGitHub <noreply@github.com>
Tue, 30 Jan 2024 18:44:09 +0000 (10:44 -0800)
Reduce size of _List instances

Lib/importlib/_bootstrap.py

index d942045f3de666fab79ffcfe20dbe838828f0441..6d6292f95592534db66c24c43c33488c8e96b274 100644 (file)
@@ -53,7 +53,7 @@ def _new_module(name):
 
 # For a list that can have a weakref to it.
 class _List(list):
-    pass
+    __slots__ = ("__weakref__",)
 
 
 # Copied from weakref.py with some simplifications and modifications unique to