This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients rhettinger, serhiy.storchaka, xtreak
Date 2019-03-17.12:50:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1552827022.97.0.131454099371.issue36326@roundup.psfhosted.org>
In-reply-to
Content
I am not sure that this is the best application of dict as __slots__. Maybe use dict for specifying default values? Currently slots are not compatible with class-level values used as fallbacks.

Following the pattern for namedtuple attributes, docstrings for slots could be specified as:

class Bicycle:
       __slots__ = 'category', 'model', 'size', 'price'

Bicycle.category.__doc__ = 'Primary use: road, cross-over, or hybrid'
Bicycle.model.__doc__ = 'Unique six digit vendor-supplied code'
Bicycle.size.__doc__ = 'Rider size: child, small, medium, large, extra-large'
Bicycle.price.__doc__ = 'Manufacturer suggested retail price'
History
Date User Action Args
2019-03-17 12:50:23serhiy.storchakasetrecipients: + serhiy.storchaka, rhettinger, xtreak
2019-03-17 12:50:22serhiy.storchakasetmessageid: <1552827022.97.0.131454099371.issue36326@roundup.psfhosted.org>
2019-03-17 12:50:22serhiy.storchakalinkissue36326 messages
2019-03-17 12:50:22serhiy.storchakacreate