From 3b8d317bba0afb0a9671785719a20420f36b2e20 Mon Sep 17 00:00:00 2001 From: harshul1610 Date: Sun, 19 Feb 2017 20:25:03 +0530 Subject: [PATCH 1/3] bpo-28886: Move deprecated abc module decorators to separate section in docs --- Doc/library/abc.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Doc/library/abc.rst b/Doc/library/abc.rst index 966003bd45ada1..023df1b5e57939 100644 --- a/Doc/library/abc.rst +++ b/Doc/library/abc.rst @@ -221,6 +221,8 @@ The :mod:`abc` module also provides the following decorators: multiple-inheritance. +The :mod:`abc` module also support following legacy builtin decorators: + .. decorator:: abstractclassmethod A subclass of the built-in :func:`classmethod`, indicating an abstract From 12962b5f59452a5e0df0ffb926e6c9a2cfab386d Mon Sep 17 00:00:00 2001 From: harshul1610 Date: Sun, 26 Feb 2017 11:06:46 +0530 Subject: [PATCH 2/3] bpo-28886: Fix Typo and some better organising of the description. --- Doc/library/abc.rst | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/Doc/library/abc.rst b/Doc/library/abc.rst index 023df1b5e57939..e5493cbdfd6333 100644 --- a/Doc/library/abc.rst +++ b/Doc/library/abc.rst @@ -221,10 +221,15 @@ The :mod:`abc` module also provides the following decorators: multiple-inheritance. -The :mod:`abc` module also support following legacy builtin decorators: +The :mod:`abc` module also supports the following legacy builtin 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`. @@ -238,14 +243,14 @@ The :mod:`abc` module also support following legacy builtin 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`. @@ -259,14 +264,14 @@ The :mod:`abc` module also support following legacy builtin 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. @@ -309,12 +314,6 @@ The :mod:`abc` module also support following legacy builtin 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() From d8f7b204e0a916432e8bb2141f4a45c676aa1f74 Mon Sep 17 00:00:00 2001 From: INADA Naoki Date: Wed, 21 Feb 2018 12:23:07 +0900 Subject: [PATCH 3/3] small fix --- Doc/library/abc.rst | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Doc/library/abc.rst b/Doc/library/abc.rst index e5493cbdfd6333..06ac50855afb34 100644 --- a/Doc/library/abc.rst +++ b/Doc/library/abc.rst @@ -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 @@ -221,7 +221,7 @@ The :mod:`abc` module also provides the following decorators: multiple-inheritance. -The :mod:`abc` module also supports the following legacy builtin decorators: +The :mod:`abc` module also supports the following legacy decorators: .. decorator:: abstractclassmethod @@ -275,12 +275,6 @@ The :mod:`abc` module also supports the following legacy builtin decorators: 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::