-
-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
__slots__ as a dict is not documented in the data model docs. #114044
Comments
The data-model docs do mention this, in the fourth-from-last bullet point on (See discussion in that PR for why it was decided not to have more prominent documentation for this feature.) |
@rhettinger, I'm somewhat confused by your comment in #113878 (comment), since you reviewed that PR :) |
Ah, good point @AlexWaygood. I clearly didn't read far enough, and it's true that a dict with str keys is an iterable of strings. |
Starting with 3.8,
__slots__
can be adict
, mapping slot names to docstrings. See https://docs.python.org/3/whatsnew/3.8.html#inspectHowever, https://docs.python.org/3/reference/datamodel.html does not mention this, but it should.
This came up in issue #113878 for adding docstrings to slots in dataclasses.
The text was updated successfully, but these errors were encountered: