[issue12766] strange interaction between __slots__ and class-level attributes

Benjamin Peterson report at bugs.python.org
Wed Aug 17 01:29:45 CEST 2011


Benjamin Peterson <benjamin at python.org> added the comment:

I'm afraid that's not (easily) possible. Using __slots__ implicitly gives classes attributes, so what you are seeing is the effect of toying with that. It's not really possible to pretend there are different attributes on the class than the descriptors. We can:

- Silently override slot descrs with attributes (as currently done).
- Warn or error out on conflicts.
- Just override other class attributes with the descrs.

----------

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


More information about the Python-bugs-list mailing list