[issue22098] Behavior of Structure inconsistent with BigEndianStructure when using __slots__

eryksun report at bugs.python.org
Fri Aug 22 16:58:41 CEST 2014


eryksun added the comment:

Since BigEndianStructure doesn't explicitly define the instance slots, they get the default slots for __dict__ and __weakref__. It wouldn't make sense to exclude these slots from instances of the Point2 subclass, so there's no mechanism for that. You can only add slots.

That said, the BigEndianStructure and LittleEndianStructure subclasses should define __slots__ = (). That removes the inconsistency.

http://hg.python.org/cpython/file/c0e311e010fc/Lib/ctypes/_endian.py#l46

----------
nosy: +eryksun

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22098>
_______________________________________


More information about the Python-bugs-list mailing list