From: Nikita Sobolev Date: Tue, 11 Apr 2023 13:50:25 +0000 (+0300) Subject: gh-87864: Use correct function definition syntax in the docs (#103312) X-Git-Tag: v3.12.0b1~567 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=50b4b1598411ed393f47ce7f4fffbe5b9063cd42;p=thirdparty%2FPython%2Fcpython.git gh-87864: Use correct function definition syntax in the docs (#103312) --- diff --git a/Doc/glossary.rst b/Doc/glossary.rst index 3d74d550dc34..53e8cdcae1cd 100644 --- a/Doc/glossary.rst +++ b/Doc/glossary.rst @@ -214,7 +214,7 @@ Glossary A callable is an object that can be called, possibly with a set 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. An instance of a class that implements the :meth:`~object.__call__` diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 8797485cd05d..7792e598c115 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -1681,7 +1681,7 @@ are always available. They are listed here in alphabetical order. class C: @staticmethod - def f(arg1, arg2, ...): ... + def f(arg1, arg2, argN): ... The ``@staticmethod`` form is a function :term:`decorator` -- see :ref:`function` for details. diff --git a/Lib/abc.py b/Lib/abc.py index 42048ddb8553..f8a4e11ce9c3 100644 --- a/Lib/abc.py +++ b/Lib/abc.py @@ -18,7 +18,7 @@ def abstractmethod(funcobj): class C(metaclass=ABCMeta): @abstractmethod - def my_abstract_method(self, ...): + def my_abstract_method(self, arg1, arg2, argN): ... """ funcobj.__isabstractmethod__ = True diff --git a/Objects/funcobject.c b/Objects/funcobject.c index ce5d7bda32c0..78c1144afca2 100644 --- a/Objects/funcobject.c +++ b/Objects/funcobject.c @@ -942,7 +942,7 @@ functools_wraps(PyObject *wrapper, PyObject *wrapped) class C: @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 @@ -1066,7 +1066,7 @@ To declare a class method, use this idiom:\n\ \n\ class C:\n\ @classmethod\n\ - def f(cls, arg1, arg2, ...):\n\ + def f(cls, arg1, arg2, argN):\n\ ...\n\ \n\ It can be called either on the class (e.g. C.f()) or on an instance\n\ @@ -1138,7 +1138,7 @@ PyClassMethod_New(PyObject *callable) class C: @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 @@ -1260,7 +1260,7 @@ To declare a static method, use this idiom:\n\ \n\ class C:\n\ @staticmethod\n\ - def f(arg1, arg2, ...):\n\ + def f(arg1, arg2, argN):\n\ ...\n\ \n\ It can be called either on the class (e.g. C.f()) or on an instance\n\