[issue36325] Build-out help() to support a class level data dictionary

Raymond Hettinger report at bugs.python.org
Sun Mar 17 05:51:00 EDT 2019


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

Something like this would be especially helpful for classes using __slots__. 

The member objects show-up in help(), but there is no way to attach an explanation like we can with property objects.

So there is a slots only alternative that would only involve modifying help() and nothing else:

   class Bicycle:

       __slots__ = dict(
           category = 'Primary use: road, cross-over, or hybrid',
           model = 'Unique six digit vendor-supplied code',
           size = 'Rider size: child, small, medium, large, extra-large',
           price = 'Manufacturer suggested retail price', 
       )

----------

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


More information about the Python-bugs-list mailing list