[Python-checkins] bpo-27505: Add change notes in module attribute docs (GH-5320)

Nick Coghlan webhook-mailer at python.org
Fri Jan 26 21:40:54 EST 2018


https://github.com/python/cpython/commit/85527cf50a9a4eecaca4022f7c6cb9e0bae1fa5f
commit: 85527cf50a9a4eecaca4022f7c6cb9e0bae1fa5f
branch: master
author: Cheryl Sabella <cheryl.sabella at gmail.com>
committer: Nick Coghlan <ncoghlan at gmail.com>
date: 2018-01-27T12:40:52+10:00
summary:

bpo-27505: Add change notes in module attribute docs (GH-5320)

Make it clear that setting __class__ on a module has worked since 3.5,
but support for __getattr__ and __dir__ on module instances requires 3.7+

Patch by Cheryl Sabella.

files:
M Doc/reference/datamodel.rst

diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst
index 8d47002065f..25b95c11543 100644
--- a/Doc/reference/datamodel.rst
+++ b/Doc/reference/datamodel.rst
@@ -1564,6 +1564,17 @@ a module object to a subclass of :class:`types.ModuleType`. For example::
    the module globals (whether by code within the module, or via a reference
    to the module's globals dictionary) is unaffected.
 
+.. versionchanged:: 3.5
+   ``__class__`` module attribute is now writable.
+
+.. versionadded:: 3.7
+   ``__getattr__`` and ``__dir__`` module attributes.
+
+.. seealso::
+
+   :pep:`562` - Module __getattr__ and __dir__
+      Describes the ``__getattr__`` and ``__dir__`` functions on modules.
+
 
 .. _descriptors:
 



More information about the Python-checkins mailing list