mirror of
https://github.com/python/cpython.git
synced 2025-11-09 10:01:42 +00:00
gh-87864: Use correct function definition syntax in the docs (GH-103312)
(cherry picked from commit 50b4b15984)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
This commit is contained in:
parent
07a2851edb
commit
e715da6db1
4 changed files with 7 additions and 7 deletions
|
|
@ -214,7 +214,7 @@ Glossary
|
||||||
A callable is an object that can be called, possibly with a set
|
A callable is an object that can be called, possibly with a set
|
||||||
of arguments (see :term:`argument`), with the following syntax::
|
of arguments (see :term:`argument`), with the following syntax::
|
||||||
|
|
||||||
callable(argument1, argument2, ...)
|
callable(argument1, argument2, argumentN)
|
||||||
|
|
||||||
A :term:`function`, and by extension a :term:`method`, is a callable.
|
A :term:`function`, and by extension a :term:`method`, is a callable.
|
||||||
An instance of a class that implements the :meth:`~object.__call__`
|
An instance of a class that implements the :meth:`~object.__call__`
|
||||||
|
|
|
||||||
|
|
@ -1677,7 +1677,7 @@ are always available. They are listed here in alphabetical order.
|
||||||
|
|
||||||
class C:
|
class C:
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def f(arg1, arg2, ...): ...
|
def f(arg1, arg2, argN): ...
|
||||||
|
|
||||||
The ``@staticmethod`` form is a function :term:`decorator` -- see
|
The ``@staticmethod`` form is a function :term:`decorator` -- see
|
||||||
:ref:`function` for details.
|
:ref:`function` for details.
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ class that has a metaclass derived from ABCMeta cannot be
|
||||||
|
|
||||||
class C(metaclass=ABCMeta):
|
class C(metaclass=ABCMeta):
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def my_abstract_method(self, ...):
|
def my_abstract_method(self, arg1, arg2, argN):
|
||||||
...
|
...
|
||||||
"""
|
"""
|
||||||
funcobj.__isabstractmethod__ = True
|
funcobj.__isabstractmethod__ = True
|
||||||
|
|
|
||||||
|
|
@ -845,7 +845,7 @@ functools_wraps(PyObject *wrapper, PyObject *wrapped)
|
||||||
|
|
||||||
class C:
|
class C:
|
||||||
@classmethod
|
@classmethod
|
||||||
def f(cls, arg1, arg2, ...):
|
def f(cls, arg1, arg2, argN):
|
||||||
...
|
...
|
||||||
|
|
||||||
It can be called either on the class (e.g. C.f()) or on an instance
|
It can be called either on the class (e.g. C.f()) or on an instance
|
||||||
|
|
@ -970,7 +970,7 @@ To declare a class method, use this idiom:\n\
|
||||||
\n\
|
\n\
|
||||||
class C:\n\
|
class C:\n\
|
||||||
@classmethod\n\
|
@classmethod\n\
|
||||||
def f(cls, arg1, arg2, ...):\n\
|
def f(cls, arg1, arg2, argN):\n\
|
||||||
...\n\
|
...\n\
|
||||||
\n\
|
\n\
|
||||||
It can be called either on the class (e.g. C.f()) or on an instance\n\
|
It can be called either on the class (e.g. C.f()) or on an instance\n\
|
||||||
|
|
@ -1043,7 +1043,7 @@ PyClassMethod_New(PyObject *callable)
|
||||||
|
|
||||||
class C:
|
class C:
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def f(arg1, arg2, ...):
|
def f(arg1, arg2, argN):
|
||||||
...
|
...
|
||||||
|
|
||||||
It can be called either on the class (e.g. C.f()) or on an instance
|
It can be called either on the class (e.g. C.f()) or on an instance
|
||||||
|
|
@ -1167,7 +1167,7 @@ To declare a static method, use this idiom:\n\
|
||||||
\n\
|
\n\
|
||||||
class C:\n\
|
class C:\n\
|
||||||
@staticmethod\n\
|
@staticmethod\n\
|
||||||
def f(arg1, arg2, ...):\n\
|
def f(arg1, arg2, argN):\n\
|
||||||
...\n\
|
...\n\
|
||||||
\n\
|
\n\
|
||||||
It can be called either on the class (e.g. C.f()) or on an instance\n\
|
It can be called either on the class (e.g. C.f()) or on an instance\n\
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue