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 | 01d17190627ea7b33d7a36cbaf22b7dd9799b72f (patch) | |
| tree | ffa4ffcbb2847d0ec7f35f3bd324a22e5c0494da /Doc/reference/datamodel.rst | |
| parent | 6074f217db7433b8ba7b025c1264b97396e32924 (diff) | |
| download | cpython-git-01d17190627ea7b33d7a36cbaf22b7dd9799b72f.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: |
