Skip to content

Commit c95cdf2

Browse files
Clarify the order of a stacked abstractmethod (GH-26892)
Co-authored-by: Tal Einat <[email protected]> (cherry picked from commit 74d60ea) Co-authored-by: Ram Rachum <[email protected]>
1 parent e1f3bd2 commit c95cdf2

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

Lib/abc.py

+24-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,14 @@ 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, use 'classmethod' with 'abstractmethod' instead:
32+
33+
class C(ABC):
34+
@classmethod
35+
@abstractmethod
36+
def my_abstract_classmethod(cls, ...):
37+
...
38+
3239
"""
3340

3441
__isabstractmethod__ = True
@@ -41,7 +48,14 @@ def __init__(self, callable):
4148
class abstractstaticmethod(staticmethod):
4249
"""A decorator indicating abstract staticmethods.
4350
44-
Deprecated, use 'staticmethod' with 'abstractmethod' instead.
51+
Deprecated, use 'staticmethod' with 'abstractmethod' instead:
52+
53+
class C(ABC):
54+
@staticmethod
55+
@abstractmethod
56+
def my_abstract_staticmethod(...):
57+
...
58+
4559
"""
4660

4761
__isabstractmethod__ = True
@@ -54,7 +68,14 @@ def __init__(self, callable):
5468
class abstractproperty(property):
5569
"""A decorator indicating abstract properties.
5670
57-
Deprecated, use 'property' with 'abstractmethod' instead.
71+
Deprecated, use 'property' with 'abstractmethod' instead:
72+
73+
class C(ABC):
74+
@property
75+
@abstractmethod
76+
def my_abstract_property(self):
77+
...
78+
5879
"""
5980

6081
__isabstractmethod__ = True

0 commit comments

Comments
 (0)