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

Skip to content

Commit 7452f6d

Browse files
miss-islingtonharshuljain13
authored andcommitted
bpo-28886: doc: Move deprecated abc decorators to separate section (GH-176)
(cherry picked from commit 52c6b89) Co-authored-by: Harshul jain <[email protected]>
1 parent 98a86cb commit 7452f6d

File tree

1 file changed

+17
-22
lines changed

1 file changed

+17
-22
lines changed

Doc/library/abc.rst

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ a helper class :class:`ABC` to alternatively define ABCs through inheritance:
160160

161161

162162

163-
The :mod:`abc` module also provides the following decorators:
163+
The :mod:`abc` module also provides the following decorator:
164164

165165
.. decorator:: abstractmethod
166166

@@ -236,8 +236,15 @@ The :mod:`abc` module also provides the following decorators:
236236
multiple-inheritance.
237237

238238

239+
The :mod:`abc` module also supports the following legacy decorators:
240+
239241
.. decorator:: abstractclassmethod
240242

243+
.. versionadded:: 3.2
244+
.. deprecated:: 3.3
245+
It is now possible to use :class:`classmethod` with
246+
:func:`abstractmethod`, making this decorator redundant.
247+
241248
A subclass of the built-in :func:`classmethod`, indicating an abstract
242249
classmethod. Otherwise it is similar to :func:`abstractmethod`.
243250

@@ -251,14 +258,14 @@ The :mod:`abc` module also provides the following decorators:
251258
def my_abstract_classmethod(cls, ...):
252259
...
253260

261+
262+
.. decorator:: abstractstaticmethod
263+
254264
.. versionadded:: 3.2
255265
.. deprecated:: 3.3
256-
It is now possible to use :class:`classmethod` with
266+
It is now possible to use :class:`staticmethod` with
257267
:func:`abstractmethod`, making this decorator redundant.
258268

259-
260-
.. decorator:: abstractstaticmethod
261-
262269
A subclass of the built-in :func:`staticmethod`, indicating an abstract
263270
staticmethod. Otherwise it is similar to :func:`abstractmethod`.
264271

@@ -272,23 +279,17 @@ The :mod:`abc` module also provides the following decorators:
272279
def my_abstract_staticmethod(...):
273280
...
274281

275-
.. versionadded:: 3.2
276-
.. deprecated:: 3.3
277-
It is now possible to use :class:`staticmethod` with
278-
:func:`abstractmethod`, making this decorator redundant.
279-
280282

281283
.. decorator:: abstractproperty
282284

285+
.. deprecated:: 3.3
286+
It is now possible to use :class:`property`, :meth:`property.getter`,
287+
:meth:`property.setter` and :meth:`property.deleter` with
288+
:func:`abstractmethod`, making this decorator redundant.
289+
283290
A subclass of the built-in :func:`property`, indicating an abstract
284291
property.
285292

286-
Using this function requires that the class's metaclass is :class:`ABCMeta`
287-
or is derived from it. A class that has a metaclass derived from
288-
:class:`ABCMeta` cannot be instantiated unless all of its abstract methods
289-
and properties are overridden. The abstract properties can be called using
290-
any of the normal 'super' call mechanisms.
291-
292293
This special case is deprecated, as the :func:`property` decorator
293294
is now correctly identified as abstract when applied to an abstract
294295
method::
@@ -322,12 +323,6 @@ The :mod:`abc` module also provides the following decorators:
322323
...
323324

324325

325-
.. deprecated:: 3.3
326-
It is now possible to use :class:`property`, :meth:`property.getter`,
327-
:meth:`property.setter` and :meth:`property.deleter` with
328-
:func:`abstractmethod`, making this decorator redundant.
329-
330-
331326
The :mod:`abc` module also provides the following functions:
332327

333328
.. function:: get_cache_token()

0 commit comments

Comments
 (0)