From 48be3652f9952687a1e8e3b3d93967c09174a333 Mon Sep 17 00:00:00 2001 From: Cheryl Sabella Date: Thu, 25 Jan 2018 10:37:05 -0500 Subject: [PATCH 1/3] bpo-27505: Add version_added to docs for module attributes --- Doc/reference/datamodel.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index 8d47002065fbe2..c78d35cc038570 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -1564,6 +1564,11 @@ 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. +.. versionadded:: 3.5 + ``__class__`` module attribute. +.. versionadded:: 3.7 + ``__getattr__`` and ``__dir__`` module attributes. + .. _descriptors: From fef4c48afb85d1ea1bbb8f38609b56f1648f210d Mon Sep 17 00:00:00 2001 From: Cheryl Sabella Date: Thu, 25 Jan 2018 19:47:36 -0500 Subject: [PATCH 2/3] Add link to PEP --- Doc/reference/datamodel.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index c78d35cc038570..48568077b6b11b 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -1566,9 +1566,15 @@ a module object to a subclass of :class:`types.ModuleType`. For example:: .. versionadded:: 3.5 ``__class__`` module attribute. + .. versionadded:: 3.7 ``__getattr__`` and ``__dir__`` module attributes. +.. seealso:: + + :pep:`562` - Module __getattr__ and __dir__ + Describes the ``__getattr__`` and ``__dir__`` functions on modules. + .. _descriptors: From f8c5775a4723ef022e5f8787e9922ff89304ba20 Mon Sep 17 00:00:00 2001 From: Cheryl Sabella Date: Fri, 26 Jan 2018 09:23:03 -0500 Subject: [PATCH 3/3] Change from versionadded to versionchanged --- Doc/reference/datamodel.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index 48568077b6b11b..25b95c115438b3 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -1564,8 +1564,8 @@ 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. -.. versionadded:: 3.5 - ``__class__`` module attribute. +.. versionchanged:: 3.5 + ``__class__`` module attribute is now writable. .. versionadded:: 3.7 ``__getattr__`` and ``__dir__`` module attributes.