summaryrefslogtreecommitdiffstats
path: root/Lib/abc.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2011-12-15 20:34:02 (GMT)
committerBenjamin Peterson <benjamin@python.org>2011-12-15 20:34:02 (GMT)
commitbfebb7b54a50f01104f7b6169de77f7fc8feb912 (patch)
treeef88caf96404fbb445d25a695eaa8e51bc750566 /Lib/abc.py
parenta8ff01ca7422117dcd906ee2ea55c5293eeceb24 (diff)
downloadcpython-bfebb7b54a50f01104f7b6169de77f7fc8feb912.zip
cpython-bfebb7b54a50f01104f7b6169de77f7fc8feb912.tar.gz
cpython-bfebb7b54a50f01104f7b6169de77f7fc8feb912.tar.bz2
improve abstract property support (closes #11610)
Thanks to Darren Dale for patch.
Diffstat (limited to 'Lib/abc.py')
-rw-r--r--Lib/abc.py19
1 files changed, 16 insertions, 3 deletions
diff --git a/Lib/abc.py b/Lib/abc.py
index 40f88b9..09778e8 100644
--- a/Lib/abc.py
+++ b/Lib/abc.py
@@ -26,7 +26,8 @@ def abstractmethod(funcobj):
class abstractclassmethod(classmethod):
- """A decorator indicating abstract classmethods.
+ """
+ A decorator indicating abstract classmethods.
Similar to abstractmethod.
@@ -36,6 +37,9 @@ class abstractclassmethod(classmethod):
@abstractclassmethod
def my_abstract_classmethod(cls, ...):
...
+
+ 'abstractclassmethod' is deprecated. Use 'classmethod' with
+ 'abstractmethod' instead.
"""
__isabstractmethod__ = True
@@ -46,7 +50,8 @@ class abstractclassmethod(classmethod):
class abstractstaticmethod(staticmethod):
- """A decorator indicating abstract staticmethods.
+ """
+ A decorator indicating abstract staticmethods.
Similar to abstractmethod.
@@ -56,6 +61,9 @@ class abstractstaticmethod(staticmethod):
@abstractstaticmethod
def my_abstract_staticmethod(...):
...
+
+ 'abstractstaticmethod' is deprecated. Use 'staticmethod' with
+ 'abstractmethod' instead.
"""
__isabstractmethod__ = True
@@ -66,7 +74,8 @@ class abstractstaticmethod(staticmethod):
class abstractproperty(property):
- """A decorator indicating abstract properties.
+ """
+ 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
@@ -88,7 +97,11 @@ class abstractproperty(property):
def getx(self): ...
def setx(self, value): ...
x = abstractproperty(getx, setx)
+
+ 'abstractproperty' is deprecated. Use 'property' with 'abstractmethod'
+ instead.
"""
+
__isabstractmethod__ = True