summaryrefslogtreecommitdiffstats
path: root/Doc/reference
diff options
context:
space:
mode:
authorCheryl Sabella <cheryl.sabella@gmail.com>2018-01-27 02:40:52 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2018-01-27 02:40:52 (GMT)
commit85527cf50a9a4eecaca4022f7c6cb9e0bae1fa5f (patch)
treef24b55d669fd84608a1d03f8d12e8eb7a6a157d7 /Doc/reference
parent37420deb80dcf0fc41a728838b0340b93ca01d90 (diff)
downloadcpython-85527cf50a9a4eecaca4022f7c6cb9e0bae1fa5f.zip
cpython-85527cf50a9a4eecaca4022f7c6cb9e0bae1fa5f.tar.gz
cpython-85527cf50a9a4eecaca4022f7c6cb9e0bae1fa5f.tar.bz2
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.
Diffstat (limited to 'Doc/reference')
-rw-r--r--Doc/reference/datamodel.rst11
1 files changed, 11 insertions, 0 deletions
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst
index 8d47002..25b95c1 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: