Skip to content

Conversation

@csabella
Copy link
Contributor

@csabella csabella commented Jan 25, 2018

.. versionadded:: 3.5
``__class__`` module attribute.
.. versionadded:: 3.7
``__getattr__`` and ``__dir__`` module attributes.
Copy link
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

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
Contributor Author

I have made the requested changes; please review again.

@bedevere-bot
Copy link

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
Copy link
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
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

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
Contributor Author

I have made the requested changes; please review again

@bedevere-bot
Copy link

Thanks for making the requested changes!

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

Copy link
Member

@berkerpeksag berkerpeksag left a 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.

@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