Skip to content

Clarify the order of a stacked abstractmethod #26892

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 5 commits into from
Jun 27, 2021
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
27 changes: 24 additions & 3 deletions Lib/abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,14 @@ def my_abstract_method(self, ...):
class abstractclassmethod(classmethod):
"""A decorator indicating abstract classmethods.

Deprecated, use 'classmethod' with 'abstractmethod' instead.
Deprecated, use 'classmethod' with 'abstractmethod' instead:

class C(ABC):
@classmethod
@abstractmethod
def my_abstract_classmethod(cls, ...):
...

"""

__isabstractmethod__ = True
Expand All @@ -41,7 +48,14 @@ def __init__(self, callable):
class abstractstaticmethod(staticmethod):
"""A decorator indicating abstract staticmethods.

Deprecated, use 'staticmethod' with 'abstractmethod' instead.
Deprecated, use 'staticmethod' with 'abstractmethod' instead:

class C(ABC):
@staticmethod
@abstractmethod
def my_abstract_staticmethod(...):
...

"""

__isabstractmethod__ = True
Expand All @@ -54,7 +68,14 @@ def __init__(self, callable):
class abstractproperty(property):
"""A decorator indicating abstract properties.

Deprecated, use 'property' with 'abstractmethod' instead.
Deprecated, use 'property' with 'abstractmethod' instead:

class C(ABC):
@property
@abstractmethod
def my_abstract_property(self):
...

"""

__isabstractmethod__ = True
Expand Down