#17035: use new style classes in classmethod/staticmethod examples. Patch by Berker Peksag.
This commit is contained in:
parent
13cee1696f
commit
ed5fba2ad9
|
@ -162,9 +162,10 @@ available. They are listed here in alphabetical order.
|
||||||
instance method receives the instance. To declare a class method, use this
|
instance method receives the instance. To declare a class method, use this
|
||||||
idiom::
|
idiom::
|
||||||
|
|
||||||
class C:
|
class C(object):
|
||||||
@classmethod
|
@classmethod
|
||||||
def f(cls, arg1, arg2, ...): ...
|
def f(cls, arg1, arg2, ...):
|
||||||
|
...
|
||||||
|
|
||||||
The ``@classmethod`` form is a function :term:`decorator` -- see the description
|
The ``@classmethod`` form is a function :term:`decorator` -- see the description
|
||||||
of function definitions in :ref:`function` for details.
|
of function definitions in :ref:`function` for details.
|
||||||
|
@ -1303,9 +1304,10 @@ available. They are listed here in alphabetical order.
|
||||||
A static method does not receive an implicit first argument. To declare a static
|
A static method does not receive an implicit first argument. To declare a static
|
||||||
method, use this idiom::
|
method, use this idiom::
|
||||||
|
|
||||||
class C:
|
class C(object):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def f(arg1, arg2, ...): ...
|
def f(arg1, arg2, ...):
|
||||||
|
...
|
||||||
|
|
||||||
The ``@staticmethod`` form is a function :term:`decorator` -- see the
|
The ``@staticmethod`` form is a function :term:`decorator` -- see the
|
||||||
description of function definitions in :ref:`function` for details.
|
description of function definitions in :ref:`function` for details.
|
||||||
|
|
Loading…
Reference in New Issue