Thanks to visit codestin.com
Credit goes to github.com

Skip to content

bpo-28886: doc: Move deprecated abc decorators to separate section #176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 21, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 17 additions & 22 deletions Doc/library/abc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ This module provides the following classes:
.. versionadded:: 3.4


The :mod:`abc` module also provides the following decorators:
The :mod:`abc` module also provides the following decorator:

.. decorator:: abstractmethod

Expand Down Expand Up @@ -221,8 +221,15 @@ The :mod:`abc` module also provides the following decorators:
multiple-inheritance.


The :mod:`abc` module also supports the following legacy decorators:

.. 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
classmethod. Otherwise it is similar to :func:`abstractmethod`.

Expand All @@ -236,14 +243,14 @@ The :mod:`abc` module also provides the following decorators:
def my_abstract_classmethod(cls, ...):
...


.. decorator:: abstractstaticmethod

.. versionadded:: 3.2
.. deprecated:: 3.3
It is now possible to use :class:`classmethod` with
It is now possible to use :class:`staticmethod` with
:func:`abstractmethod`, making this decorator redundant.


.. decorator:: abstractstaticmethod

A subclass of the built-in :func:`staticmethod`, indicating an abstract
staticmethod. Otherwise it is similar to :func:`abstractmethod`.

Expand All @@ -257,23 +264,17 @@ The :mod:`abc` module also provides the following decorators:
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(fget=None, fset=None, fdel=None, doc=None)

.. 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
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
is now correctly identified as abstract when applied to an abstract
method::
Expand Down Expand Up @@ -307,12 +308,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:

.. function:: get_cache_token()
Expand Down