Skip to content

Commit f3d7db2

Browse files
committed
Clarify the order of a stacked abstractmethod
1 parent 9049ea5 commit f3d7db2

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

Lib/abc.py

+21-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,13 @@ def my_abstract_method(self, ...):
2828
class abstractclassmethod(classmethod):
2929
"""A decorator indicating abstract classmethods.
3030
31-
Deprecated, use 'classmethod' with 'abstractmethod' instead.
31+
Deprecated, instead use `classmethod` on top of `abstractmethod`:
32+
33+
@classmethod
34+
@abstractmethod
35+
def your_function(cls):
36+
...
37+
3238
"""
3339

3440
__isabstractmethod__ = True
@@ -41,7 +47,13 @@ def __init__(self, callable):
4147
class abstractstaticmethod(staticmethod):
4248
"""A decorator indicating abstract staticmethods.
4349
44-
Deprecated, use 'staticmethod' with 'abstractmethod' instead.
50+
Deprecated, instead use `staticmethod` on top of `abstractmethod`:
51+
52+
@staticmethod
53+
@abstractmethod
54+
def your_function():
55+
...
56+
4557
"""
4658

4759
__isabstractmethod__ = True
@@ -54,7 +66,13 @@ def __init__(self, callable):
5466
class abstractproperty(property):
5567
"""A decorator indicating abstract properties.
5668
57-
Deprecated, use 'property' with 'abstractmethod' instead.
69+
Deprecated, instead use `property` on top of `abstractmethod`:
70+
71+
@property
72+
@abstractmethod
73+
def your_function(self):
74+
...
75+
5876
"""
5977

6078
__isabstractmethod__ = True

0 commit comments

Comments
 (0)