[issue36326] Build-out help() to read __slots__ with an optional data dictionary

Raymond Hettinger report at bugs.python.org
Tue Mar 19 14:55:45 EDT 2019


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

The direct assignments to __doc__ are reasonable for named tuples because there usually isn't any code between the factory function call and the __doc__ assignments.  For other classes, the technique is awkward because it widely separates the initial field name iterable from the corresponding docstrings.

Setting default values is responsibility of the __new__ or __init__ methods. It doesn't make sense to use a __slots__ dictionary for this purpose as well.

----------

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


More information about the Python-bugs-list mailing list