Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

bpo-27505: Add version_added to docs for module attributes#5320

Merged
ncoghlan merged 3 commits into
python:masterpython/cpython:masterfrom
csabella:bpo27505csabella/cpython:bpo27505Copy head branch name to clipboard
Jan 27, 2018
Merged

bpo-27505: Add version_added to docs for module attributes#5320
ncoghlan merged 3 commits into
python:masterpython/cpython:masterfrom
csabella:bpo27505csabella/cpython:bpo27505Copy head branch name to clipboard

Conversation

@csabella

@csabella csabella commented Jan 25, 2018

Copy link
Copy Markdown
Contributor

.. versionadded:: 3.5
``__class__`` module attribute.
.. versionadded:: 3.7
``__getattr__`` and ``__dir__`` module attributes.

Copy link
Copy Markdown
Member

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?

@bedevere-bot

Copy link
Copy Markdown

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. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@csabella

Copy link
Copy Markdown
Contributor Author

I have made the requested changes; please review again.

@bedevere-bot

Copy link
Copy Markdown

Thanks for making the requested changes!

@berkerpeksag: please review the changes made to this pull request.

Comment thread 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

Copy link
Copy Markdown
Member

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 types

So I think this should be changed to use versionchanged instead of versionadded and it should say that the __class__ attribute is now writable.

Copy link
Copy Markdown
Contributor Author

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.

@bedevere-bot

Copy link
Copy Markdown

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. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@csabella

Copy link
Copy Markdown
Contributor Author

I have made the requested changes; please review again

@bedevere-bot

Copy link
Copy Markdown

Thanks for making the requested changes!

@berkerpeksag: please review the changes made to this pull request.

@berkerpeksag berkerpeksag left a comment

Copy link
Copy Markdown
Member

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.

@ncoghlan ncoghlan merged commit 85527cf into python:master Jan 27, 2018
@csabella csabella deleted the bpo27505 branch January 27, 2018 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.