bpo-27505: Add version_added to docs for module attributes#5320
bpo-27505: Add version_added to docs for module attributes#5320
Conversation
| .. versionadded:: 3.5 | ||
| ``__class__`` module attribute. | ||
| .. versionadded:: 3.7 | ||
| ``__getattr__`` and ``__dir__`` module attributes. |
There was a problem hiding this comment.
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. |
| 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.
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.
@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.
LGTM, thank you! I will wait for a bit to give @ncoghlan time to review before merging this.
https://bugs.python.org/issue27505