[issue1173475] __slots__ for subclasses of variable length types

Ronald Oussoren report at bugs.python.org
Tue Mar 19 16:41:01 CET 2013


Ronald Oussoren added the comment:

I do have a usecase for this: subclasses of int. 

Having slots would be nice for a reasonably efficient implementation of named constants (as recently discussed on python-ideas), and I'm already using a subclass of int of PyObjC to attach a single other value to a Python integer. In both cases the overhead of the __dict__ is pretty large.

----------
nosy: +ronaldoussoren
versions: +Python 3.4 -Python 3.3

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


More information about the Python-bugs-list mailing list