stdlib: add __slots__ (#14611)

This commit is contained in:
Jelle Zijlstra
2025-08-21 07:24:59 -07:00
committed by GitHub
parent 28abff1eb3
commit f32d9f08bd
38 changed files with 247 additions and 12 deletions
+6 -2
View File
@@ -3,10 +3,14 @@ from ctypes import Structure, Union
# At runtime, the native endianness is an alias for Structure,
# while the other is a subclass with a metaclass added in.
class BigEndianStructure(Structure): ...
class BigEndianStructure(Structure):
__slots__ = ()
class LittleEndianStructure(Structure): ...
# Same thing for these: one is an alias of Union at runtime
if sys.version_info >= (3, 11):
class BigEndianUnion(Union): ...
class BigEndianUnion(Union):
__slots__ = ()
class LittleEndianUnion(Union): ...