[issue46246] importlib.metadata.DeprecatedList appears to be missing __slots__

Jason R. Coombs report at bugs.python.org
Mon Jan 3 19:13:08 EST 2022


Jason R. Coombs <jaraco at jaraco.com> added the comment:

Perhaps it is a mistake. The `__slots__` were added as a (possible premature) optimization in [this conversation](https://github.com/python/importlib_metadata/pull/278/files#r565475347).

It's not obvious to me what the danger is in defining __slots__ in a child class but not in a parent. Can you point me to resources or examples that help me understand the concern or missed expectation? The primary motivation behind defining slots is to help ensure immutability.  Does the lack of slots violate that expectation?

Convince me of the value of fixing this concern and please feel free to proceed with a PR.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46246>
_______________________________________


More information about the Python-bugs-list mailing list