Skip to content

Commit 6a95300

Browse files
gh-133438: Fix the use of the terms "argument" and "parameter" in the documentation
1 parent a10b321 commit 6a95300

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+189
-180
lines changed

Doc/c-api/arg.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,8 @@ inside nested parentheses. They are:
410410

411411
``$``
412412
:c:func:`PyArg_ParseTupleAndKeywords` only:
413-
Indicates that the remaining arguments in the Python argument list are
414-
keyword-only. Currently, all keyword-only arguments must also be optional
413+
Indicates that the remaining arguments in the Python argument list can be
414+
supplied only by keyword. Currently, all such arguments must also be optional
415415
arguments, so ``|`` must always be specified before ``$`` in the format
416416
string.
417417

@@ -450,7 +450,7 @@ API Functions
450450

451451
.. c:function:: int PyArg_ParseTuple(PyObject *args, const char *format, ...)
452452
453-
Parse the parameters of a function that takes only positional parameters into
453+
Parse the arguments of a function that takes only positional arguments into
454454
local variables. Returns true on success; on failure, it returns false and
455455
raises the appropriate exception.
456456
@@ -463,8 +463,8 @@ API Functions
463463
464464
.. c:function:: int PyArg_ParseTupleAndKeywords(PyObject *args, PyObject *kw, const char *format, char * const *keywords, ...)
465465
466-
Parse the parameters of a function that takes both positional and keyword
467-
parameters into local variables.
466+
Parse the arguments of a function that takes both positional and keyword
467+
arguments into local variables.
468468
The *keywords* argument is a ``NULL``-terminated array of keyword parameter
469469
names specified as null-terminated ASCII or UTF-8 encoded C strings.
470470
Empty names denote
@@ -506,7 +506,7 @@ API Functions
506506
507507
.. c:function:: int PyArg_Parse(PyObject *args, const char *format, ...)
508508
509-
Parse the parameter of a function that takes a single positional parameter
509+
Parse the argument of a function that takes a single positional parameter
510510
into a local variable. Returns true on success; on failure, it returns
511511
false and raises the appropriate exception.
512512

Doc/c-api/code.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ bound into a function.
7171
7272
.. c:function:: PyCodeObject* PyUnstable_Code_NewWithPosOnlyArgs(int argcount, int posonlyargcount, int kwonlyargcount, int nlocals, int stacksize, int flags, PyObject *code, PyObject *consts, PyObject *names, PyObject *varnames, PyObject *freevars, PyObject *cellvars, PyObject *filename, PyObject *name, PyObject *qualname, int firstlineno, PyObject *linetable, PyObject *exceptiontable)
7373
74-
Similar to :c:func:`PyUnstable_Code_New`, but with an extra "posonlyargcount" for positional-only arguments.
74+
Similar to :c:func:`PyUnstable_Code_New`, but with an extra "posonlyargcount" for positional-only parameters.
7575
The same caveats that apply to ``PyUnstable_Code_New`` also apply to this function.
7676
7777
.. index:: single: PyCode_NewWithPosOnlyArgs (C function)

Doc/c-api/veryhigh.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ the same library that the Python runtime is using.
267267
evaluation. This environment consists of a dictionary of global variables,
268268
a mapping object of local variables, arrays of arguments, keywords and
269269
defaults, a dictionary of default values for :ref:`keyword-only
270-
<keyword-only_parameter>` arguments and a closure tuple of cells.
270+
<keyword-only_parameter>` parameters and a closure tuple of cells.
271271
272272
273273
.. c:function:: PyObject* PyEval_EvalFrame(PyFrameObject *f)

Doc/deprecations/pending-removal-in-3.19.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Pending removal in Python 3.19
1818
Support for the ``string`` keyword argument name is now deprecated
1919
and slated for removal in Python 3.19.
2020

21-
Before Python 3.13, the ``string`` keyword parameter was not correctly
21+
Before Python 3.13, the ``string`` keyword argument was not correctly
2222
supported depending on the backend implementation of hash functions.
2323
Prefer passing the initial data as a positional argument for maximum
2424
backwards compatibility.

Doc/faq/programming.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,8 @@ You could use a global variable containing a dictionary instead of the default
390390
value; it's a matter of taste.
391391

392392

393-
How can I pass optional or keyword parameters from one function to another?
394-
---------------------------------------------------------------------------
393+
How can I pass optional positional or keyword arguments from one function to another?
394+
-------------------------------------------------------------------------------------
395395

396396
Collect the arguments using the ``*`` and ``**`` specifiers in the function's
397397
parameter list; this gives you the positional arguments as a tuple and the

Doc/howto/logging-cookbook.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1634,7 +1634,7 @@ method. Since then, Python has gained two new formatting approaches:
16341634

16351635
Logging (as of 3.2) provides improved support for these two additional
16361636
formatting styles. The :class:`Formatter` class been enhanced to take an
1637-
additional, optional keyword parameter named ``style``. This defaults to
1637+
additional, optional keyword argument named ``style``. This defaults to
16381638
``'%'``, but other possible values are ``'{'`` and ``'$'``, which correspond
16391639
to the other two formatting styles. Backwards compatibility is maintained by
16401640
default (as you would expect), but by explicitly specifying a style parameter,
@@ -1675,10 +1675,10 @@ That can still use %-formatting, as shown here::
16751675
>>>
16761676

16771677
Logging calls (``logger.debug()``, ``logger.info()`` etc.) only take
1678-
positional parameters for the actual logging message itself, with keyword
1679-
parameters used only for determining options for how to handle the actual
1680-
logging call (e.g. the ``exc_info`` keyword parameter to indicate that
1681-
traceback information should be logged, or the ``extra`` keyword parameter
1678+
positional arguments for the actual logging message itself, with keyword
1679+
arguments used only for determining options for how to handle the actual
1680+
logging call (e.g. the ``exc_info`` keyword argument to indicate that
1681+
traceback information should be logged, or the ``extra`` keyword argument
16821682
to indicate additional contextual information to be added to the log). So
16831683
you cannot directly make logging calls using :meth:`str.format` or
16841684
:class:`string.Template` syntax, because internally the logging package
@@ -2732,10 +2732,10 @@ governs the formatting of logging messages for final output to logs, and is
27322732
completely orthogonal to how an individual logging message is constructed.
27332733

27342734
Logging calls (:meth:`~Logger.debug`, :meth:`~Logger.info` etc.) only take
2735-
positional parameters for the actual logging message itself, with keyword
2736-
parameters used only for determining options for how to handle the logging call
2737-
(e.g. the ``exc_info`` keyword parameter to indicate that traceback information
2738-
should be logged, or the ``extra`` keyword parameter to indicate additional
2735+
positional arguments for the actual logging message itself, with keyword
2736+
arguments used only for determining options for how to handle the logging call
2737+
(e.g. the ``exc_info`` keyword argument to indicate that traceback information
2738+
should be logged, or the ``extra`` keyword argument to indicate additional
27392739
contextual information to be added to the log). So you cannot directly make
27402740
logging calls using :meth:`str.format` or :class:`string.Template` syntax,
27412741
because internally the logging package uses %-formatting to merge the format

Doc/library/ast.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1930,21 +1930,22 @@ Function and class definitions
19301930

19311931
.. class:: arguments(posonlyargs, args, vararg, kwonlyargs, kw_defaults, kwarg, defaults)
19321932

1933-
The arguments for a function.
1933+
The parameters for a function.
19341934

19351935
* ``posonlyargs``, ``args`` and ``kwonlyargs`` are lists of :class:`arg` nodes.
19361936
* ``vararg`` and ``kwarg`` are single :class:`arg` nodes, referring to the
19371937
``*args, **kwargs`` parameters.
1938-
* ``kw_defaults`` is a list of default values for keyword-only arguments. If
1938+
* ``kw_defaults`` is a list of default values for keyword-only parameters. If
19391939
one is ``None``, the corresponding argument is required.
1940-
* ``defaults`` is a list of default values for arguments that can be passed
1941-
positionally. If there are fewer defaults, they correspond to the last n
1942-
arguments.
1940+
* ``defaults`` is a list of default values for positional-only and
1941+
keyword-or-positional parameter.
1942+
If there are fewer defaults, they correspond to the last n
1943+
parameters.
19431944

19441945

19451946
.. class:: arg(arg, annotation, type_comment)
19461947

1947-
A single argument in a list. ``arg`` is a raw string of the argument
1948+
A single parameter in a list. ``arg`` is a raw string of the parameter
19481949
name; ``annotation`` is its annotation, such as a :class:`Name` node.
19491950

19501951
.. attribute:: type_comment

Doc/library/asyncio-eventloop.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ Scheduling callbacks
232232
Callbacks are called in the order in which they are registered.
233233
Each callback will be called exactly once.
234234

235-
The optional keyword-only *context* argument specifies a
235+
The optional keyword argument *context* specifies a
236236
custom :class:`contextvars.Context` for the *callback* to run in.
237237
Callbacks use the current context when no *context* is provided.
238238

@@ -296,11 +296,11 @@ clocks to track time.
296296
scheduled for exactly the same time, the order in which they
297297
are called is undefined.
298298

299-
The optional positional *args* will be passed to the callback when
299+
The optional positional arguments *args* will be passed to the callback when
300300
it is called. If you want the callback to be called with keyword
301301
arguments use :func:`functools.partial`.
302302

303-
An optional keyword-only *context* argument allows specifying a
303+
An optional keyword argument *context* allows specifying a
304304
custom :class:`contextvars.Context` for the *callback* to run in.
305305
The current context is used when no *context* is provided.
306306

@@ -377,11 +377,11 @@ Creating Futures and Tasks
377377
If the *name* argument is provided and not ``None``, it is set as
378378
the name of the task using :meth:`Task.set_name`.
379379

380-
An optional keyword-only *context* argument allows specifying a
380+
An optional keyword argument *context* allows specifying a
381381
custom :class:`contextvars.Context` for the *coro* to run in.
382382
The current context copy is created when no *context* is provided.
383383

384-
An optional keyword-only *eager_start* argument allows specifying
384+
An optional keyword argument *eager_start* allows specifying
385385
if the task should execute eagerly during the call to create_task,
386386
or be scheduled later. If *eager_start* is not passed the mode set
387387
by :meth:`loop.set_task_factory` will be used.

Doc/library/asyncio-future.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ Future Object
165165
If the Future is already *done* when this method is called,
166166
the callback is scheduled with :meth:`loop.call_soon`.
167167

168-
An optional keyword-only *context* argument allows specifying a
168+
An optional keyword argument *context* allows specifying a
169169
custom :class:`contextvars.Context` for the *callback* to run in.
170170
The current context is used when no *context* is provided.
171171

Doc/library/asyncio-graph.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ and debuggers.
3232
If not passed, the current running task will be used.
3333

3434
If the function is called on *the current task*, the optional
35-
keyword-only *depth* argument can be used to skip the specified
35+
keyword argument *depth* can be used to skip the specified
3636
number of frames from top of the stack.
3737

38-
If the optional keyword-only *limit* argument is provided, each call stack
38+
If the optional keyword argument *limit* is provided, each call stack
3939
in the resulting graph is truncated to include at most ``abs(limit)``
4040
entries. If *limit* is positive, the entries left are the closest to
4141
the invocation point. If *limit* is negative, the topmost entries are
@@ -91,7 +91,7 @@ and debuggers.
9191
current task, the function returns ``None``.
9292

9393
If the function is called on *the current task*, the optional
94-
keyword-only *depth* argument can be used to skip the specified
94+
keyword argument *depth* can be used to skip the specified
9595
number of frames from top of the stack.
9696

9797
Returns a ``FutureCallGraph`` data class object:

0 commit comments

Comments
 (0)