mirror of
https://github.com/python/cpython.git
synced 2025-09-28 19:25:27 +00:00
bpo-28886: doc: Move deprecated abc decorators to separate section (GH-176)
(cherry picked from commit 52c6b89796
)
Co-authored-by: Harshul jain <harshulrobo@gmail.com>
This commit is contained in:
parent
16de2a9b86
commit
0150dc5894
1 changed files with 18 additions and 23 deletions
|
@ -160,7 +160,7 @@ a helper class :class:`ABC` to alternatively define ABCs through inheritance:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
The :mod:`abc` module also provides the following decorators:
|
The :mod:`abc` module also provides the following decorator:
|
||||||
|
|
||||||
.. decorator:: abstractmethod
|
.. decorator:: abstractmethod
|
||||||
|
|
||||||
|
@ -236,8 +236,15 @@ The :mod:`abc` module also provides the following decorators:
|
||||||
multiple-inheritance.
|
multiple-inheritance.
|
||||||
|
|
||||||
|
|
||||||
|
The :mod:`abc` module also supports the following legacy decorators:
|
||||||
|
|
||||||
.. decorator:: abstractclassmethod
|
.. decorator:: abstractclassmethod
|
||||||
|
|
||||||
|
.. versionadded:: 3.2
|
||||||
|
.. deprecated:: 3.3
|
||||||
|
It is now possible to use :class:`classmethod` with
|
||||||
|
:func:`abstractmethod`, making this decorator redundant.
|
||||||
|
|
||||||
A subclass of the built-in :func:`classmethod`, indicating an abstract
|
A subclass of the built-in :func:`classmethod`, indicating an abstract
|
||||||
classmethod. Otherwise it is similar to :func:`abstractmethod`.
|
classmethod. Otherwise it is similar to :func:`abstractmethod`.
|
||||||
|
|
||||||
|
@ -251,14 +258,14 @@ The :mod:`abc` module also provides the following decorators:
|
||||||
def my_abstract_classmethod(cls, ...):
|
def my_abstract_classmethod(cls, ...):
|
||||||
...
|
...
|
||||||
|
|
||||||
.. versionadded:: 3.2
|
|
||||||
.. deprecated:: 3.3
|
|
||||||
It is now possible to use :class:`classmethod` with
|
|
||||||
:func:`abstractmethod`, making this decorator redundant.
|
|
||||||
|
|
||||||
|
|
||||||
.. decorator:: abstractstaticmethod
|
.. decorator:: abstractstaticmethod
|
||||||
|
|
||||||
|
.. versionadded:: 3.2
|
||||||
|
.. deprecated:: 3.3
|
||||||
|
It is now possible to use :class:`staticmethod` with
|
||||||
|
:func:`abstractmethod`, making this decorator redundant.
|
||||||
|
|
||||||
A subclass of the built-in :func:`staticmethod`, indicating an abstract
|
A subclass of the built-in :func:`staticmethod`, indicating an abstract
|
||||||
staticmethod. Otherwise it is similar to :func:`abstractmethod`.
|
staticmethod. Otherwise it is similar to :func:`abstractmethod`.
|
||||||
|
|
||||||
|
@ -272,23 +279,17 @@ The :mod:`abc` module also provides the following decorators:
|
||||||
def my_abstract_staticmethod(...):
|
def my_abstract_staticmethod(...):
|
||||||
...
|
...
|
||||||
|
|
||||||
.. versionadded:: 3.2
|
|
||||||
.. deprecated:: 3.3
|
|
||||||
It is now possible to use :class:`staticmethod` with
|
|
||||||
:func:`abstractmethod`, making this decorator redundant.
|
|
||||||
|
|
||||||
|
|
||||||
.. decorator:: abstractproperty
|
.. decorator:: abstractproperty
|
||||||
|
|
||||||
|
.. deprecated:: 3.3
|
||||||
|
It is now possible to use :class:`property`, :meth:`property.getter`,
|
||||||
|
:meth:`property.setter` and :meth:`property.deleter` with
|
||||||
|
:func:`abstractmethod`, making this decorator redundant.
|
||||||
|
|
||||||
A subclass of the built-in :func:`property`, indicating an abstract
|
A subclass of the built-in :func:`property`, indicating an abstract
|
||||||
property.
|
property.
|
||||||
|
|
||||||
Using this function requires that the class's metaclass is :class:`ABCMeta`
|
|
||||||
or is derived from it. A class that has a metaclass derived from
|
|
||||||
:class:`ABCMeta` cannot be instantiated unless all of its abstract methods
|
|
||||||
and properties are overridden. The abstract properties can be called using
|
|
||||||
any of the normal 'super' call mechanisms.
|
|
||||||
|
|
||||||
This special case is deprecated, as the :func:`property` decorator
|
This special case is deprecated, as the :func:`property` decorator
|
||||||
is now correctly identified as abstract when applied to an abstract
|
is now correctly identified as abstract when applied to an abstract
|
||||||
method::
|
method::
|
||||||
|
@ -322,12 +323,6 @@ The :mod:`abc` module also provides the following decorators:
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
||||||
.. deprecated:: 3.3
|
|
||||||
It is now possible to use :class:`property`, :meth:`property.getter`,
|
|
||||||
:meth:`property.setter` and :meth:`property.deleter` with
|
|
||||||
:func:`abstractmethod`, making this decorator redundant.
|
|
||||||
|
|
||||||
|
|
||||||
The :mod:`abc` module also provides the following functions:
|
The :mod:`abc` module also provides the following functions:
|
||||||
|
|
||||||
.. function:: get_cache_token()
|
.. function:: get_cache_token()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue