mirror of
https://github.com/python/cpython.git
synced 2025-08-01 07:33:08 +00:00
Fix 3k-style metaclass syntax in docstrings.
This commit is contained in:
parent
68d6852006
commit
bcf7bf3833
1 changed files with 6 additions and 3 deletions
|
@ -15,7 +15,8 @@ def abstractmethod(funcobj):
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
|
|
||||||
class C(metaclass=ABCMeta):
|
class C:
|
||||||
|
__metaclass__ = ABCMeta
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def my_abstract_method(self, ...):
|
def my_abstract_method(self, ...):
|
||||||
...
|
...
|
||||||
|
@ -35,7 +36,8 @@ class abstractproperty(property):
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
|
|
||||||
class C(metaclass=ABCMeta):
|
class C:
|
||||||
|
__metaclass__ = ABCMeta
|
||||||
@abstractproperty
|
@abstractproperty
|
||||||
def my_abstract_property(self):
|
def my_abstract_property(self):
|
||||||
...
|
...
|
||||||
|
@ -43,7 +45,8 @@ class abstractproperty(property):
|
||||||
This defines a read-only property; you can also define a read-write
|
This defines a read-only property; you can also define a read-write
|
||||||
abstract property using the 'long' form of property declaration:
|
abstract property using the 'long' form of property declaration:
|
||||||
|
|
||||||
class C(metaclass=ABCMeta):
|
class C:
|
||||||
|
__metaclass__ = ABCMeta
|
||||||
def getx(self): ...
|
def getx(self): ...
|
||||||
def setx(self, value): ...
|
def setx(self, value): ...
|
||||||
x = abstractproperty(getx, setx)
|
x = abstractproperty(getx, setx)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue