[issue13290] get vars for object with __slots__

João Bernardo report at bugs.python.org
Wed Apr 5 10:19:23 EDT 2017


João Bernardo added the comment:

Being the OP, at that time I felt it was important to have a vars() function that worked on __slots__ to ease something I was developing. The truth for me is: __slots__ is not really relevant anymore. The benefits it brings are not enough to make the feature usable because of these incompatibilities with normal classes. Also, it does not bring real benefits even for most people who think they need this.

If you believe having vars() working on __slots__ is bad because people may want to update it, why would locals() exist at all?

Also, your argument that having vars() working on __slots__ classes may mask the wrong use of the attribute, why would someone use vars() on __slots__ if it doesn't work right now? If it is not useful for identifying this problem now, then I am ok with it not being useful in the future as well.

On any case, feel free to mark this as "rejected" or "wont fix" because if in 6 years no one cared enough to have it working means that either it is not important and/or __slots__ classes are also not relevant for others as well.

----------

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


More information about the Python-bugs-list mailing list