-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
bpo-27505: Add version_added to docs for module attributes #5320
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
Conversation
| .. versionadded:: 3.5 | ||
| ``__class__`` module attribute. | ||
| .. versionadded:: 3.7 | ||
| ``__getattr__`` and ``__dir__`` module attributes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also add a link to the PEP?
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
|
I have made the requested changes; please review again. |
|
Thanks for making the requested changes! @berkerpeksag: please review the changes made to this pull request. |
Doc/reference/datamodel.rst
Outdated
| the module globals (whether by code within the module, or via a reference | ||
| to the module's globals dictionary) is unaffected. | ||
|
|
||
| .. versionadded:: 3.5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I missed this earlier. module.__class__ attribute exists in Python versions older than 3.5. From Python 3.4:
>>> from types import ModuleType
>>> sys.modules['argparse'].__class__
<class 'module'>
>>> sys.modules['argparse'].__class__ = ModuleType
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: __class__ assignment: only for heap typesSo I think this should be changed to use versionchanged instead of versionadded and it should say that the __class__ attribute is now writable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@berkerpeksag Thanks for catching that! I've also updated in #5321, which is the backport of only the class doc change to 3.6.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
|
I have made the requested changes; please review again |
|
Thanks for making the requested changes! @berkerpeksag: please review the changes made to this pull request. |
berkerpeksag
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you! I will wait for a bit to give @ncoghlan time to review before merging this.
https://bugs.python.org/issue27505