[Python-checkins] gh-87864: Use correct function definition syntax in the docs (GH-103312)

miss-islington webhook-mailer at python.org
Tue Apr 11 10:19:41 EDT 2023


https://github.com/python/cpython/commit/e715da6db1d1d70cd779dc48e1ba8110c51cc1bf
commit: e715da6db1d1d70cd779dc48e1ba8110c51cc1bf
branch: 3.11
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2023-04-11T07:19:33-07:00
summary:

gh-87864: Use correct function definition syntax in the docs (GH-103312)

(cherry picked from commit 50b4b1598411ed393f47ce7f4fffbe5b9063cd42)

Co-authored-by: Nikita Sobolev <mail at sobolevn.me>

files:
M Doc/glossary.rst
M Doc/library/functions.rst
M Lib/abc.py
M Objects/funcobject.c

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 2ce3860440be..1c3deb2e78c7 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -1677,7 +1677,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 @@ class that has a metaclass derived from ABCMeta cannot be
 
         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 57600c97e6aa..3a0553261bf1 100644
--- a/Objects/funcobject.c
+++ b/Objects/funcobject.c
@@ -845,7 +845,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
@@ -970,7 +970,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\
@@ -1043,7 +1043,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
@@ -1167,7 +1167,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\



More information about the Python-checkins mailing list