You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
assignee=Noneclosed_at=<Date2019-03-25.20:02:44.770>created_at=<Date2019-03-17.10:11:16.012>labels= ['3.8', 'type-feature', 'library']
title='Teach inpsect.getdoc() to read __slots__ with an optional data dictionary'updated_at=<Date2019-03-25.20:02:44.770>user='https://github.com/rhettinger'
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.