Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
5c117dd2
Commit
5c117dd2
authored
Dec 31, 2018
by
Serhiy Storchaka
Committed by
GitHub
Dec 31, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-35609: Remove examples for deprecated decorators in the abc module. (GH-11355)
parent
7108aab4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
46 deletions
+5
-46
Lib/abc.py
Lib/abc.py
+5
-46
No files found.
Lib/abc.py
View file @
5c117dd2
...
...
@@ -11,7 +11,8 @@ def abstractmethod(funcobj):
class that has a metaclass derived from ABCMeta cannot be
instantiated unless all of its abstract methods are overridden.
The abstract methods can be called using any of the normal
'super' call mechanisms.
'super' call mechanisms. abstractmethod() may be used to declare
abstract methods for properties and descriptors.
Usage:
...
...
@@ -27,17 +28,7 @@ def abstractmethod(funcobj):
class
abstractclassmethod
(
classmethod
):
"""A decorator indicating abstract classmethods.
Similar to abstractmethod.
Usage:
class C(metaclass=ABCMeta):
@abstractclassmethod
def my_abstract_classmethod(cls, ...):
...
'abstractclassmethod' is deprecated. Use 'classmethod' with
'abstractmethod' instead.
Deprecated, use 'classmethod' with 'abstractmethod' instead.
"""
__isabstractmethod__
=
True
...
...
@@ -50,17 +41,7 @@ class abstractclassmethod(classmethod):
class
abstractstaticmethod
(
staticmethod
):
"""A decorator indicating abstract staticmethods.
Similar to abstractmethod.
Usage:
class C(metaclass=ABCMeta):
@abstractstaticmethod
def my_abstract_staticmethod(...):
...
'abstractstaticmethod' is deprecated. Use 'staticmethod' with
'abstractmethod' instead.
Deprecated, use 'staticmethod' with 'abstractmethod' instead.
"""
__isabstractmethod__
=
True
...
...
@@ -73,29 +54,7 @@ class abstractstaticmethod(staticmethod):
class
abstractproperty
(
property
):
"""A decorator indicating abstract properties.
Requires that the metaclass is ABCMeta or derived from it. A
class that has a metaclass derived from ABCMeta cannot be
instantiated unless all of its abstract properties are overridden.
The abstract properties can be called using any of the normal
'super' call mechanisms.
Usage:
class C(metaclass=ABCMeta):
@abstractproperty
def my_abstract_property(self):
...
This defines a read-only property; you can also define a read-write
abstract property using the 'long' form of property declaration:
class C(metaclass=ABCMeta):
def getx(self): ...
def setx(self, value): ...
x = abstractproperty(getx, setx)
'abstractproperty' is deprecated. Use 'property' with 'abstractmethod'
instead.
Deprecated, use 'property' with 'abstractmethod' instead.
"""
__isabstractmethod__
=
True
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment