diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2016-07-30 14:06:15 +0300 |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2016-07-30 14:06:15 +0300 |
commit | 320abf0a0c2055e8f172c1aeab9fa51b37a9ac68 (patch) | |
tree | c09d87f89902ad89b9afc50d5fd387784702bb93 /Doc/reference/datamodel.rst | |
parent | 258dd156874e88dfb1b5db169b1e34dd8f8da771 (diff) | |
download | cpython-320abf0a0c2055e8f172c1aeab9fa51b37a9ac68.tar.gz |
Issue #27366: Tweak PEP 487 documentation
* Added versionadded directives
* Deleted duplicate sentence from __init_subclass__ docstring
* Modernized tests
Diffstat (limited to 'Doc/reference/datamodel.rst')
-rw-r--r-- | Doc/reference/datamodel.rst | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index 2a85798123..075f0967e9 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -1497,6 +1497,8 @@ class' :attr:`~object.__dict__`. Called at the time the owning class *owner* is created. The descriptor has been assigned to *name*. + .. versionadded:: 3.6 + The attribute :attr:`__objclass__` is interpreted by the :mod:`inspect` module as specifying the class where this object was defined (setting this @@ -1648,6 +1650,7 @@ applied to, ``__init_subclass__`` solely applies to future subclasses of the class defining the method. .. classmethod:: object.__init_subclass__(cls) + This method is called whenever the containing class is subclassed. *cls* is then the new subclass. If defined as a normal instance method, this method is implicitly converted to a class method. @@ -1669,6 +1672,8 @@ class defining the method. The default implementation ``object.__init_subclass__`` does nothing, but raises an error if it is called with any arguments. + .. versionadded:: 3.6 + .. _metaclasses: |