Corrected some grammar and spelling issues in documentation.
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
The :c:func:`PyConfig_Read` function only parses
:c:member:`PyConfig.argv` arguments once: :c:member:`PyConfig.parse_argv`
is set to ``2`` after arguments are parsed. Since Python arguments are
- strippped from :c:member:`PyConfig.argv`, parsing arguments twice would
+ stripped from :c:member:`PyConfig.argv`, parsing arguments twice would
parse the application options as Python options.
:ref:`Preinitialize Python <c-preinit>` if needed.
The :c:func:`PyConfig_Read` function only parses
:c:member:`PyConfig.argv` arguments once: :c:member:`PyConfig.parse_argv`
is set to ``2`` after arguments are parsed. Since Python arguments are
- strippped from :c:member:`PyConfig.argv`, parsing arguments twice would
+ stripped from :c:member:`PyConfig.argv`, parsing arguments twice would
parse the application options as Python options.
Default: ``1`` in Python mode, ``0`` in isolated mode.
:ref:`allocation domains <allocator-domains>`: "raw", "mem", and "object".
For thread-safety, the free-threaded build requires that only Python objects
are allocated using the object domain, and that all Python object are
-allocated using that domain. This differes from the prior Python versions,
+allocated using that domain. This differs from the prior Python versions,
where this was only a best practice and not a hard requirement.
.. note::
which writes to ``sys.stderr`` makes multiple writes, each of which results in a
separate logged line (for example, the last three lines above). To get around
this problem, you need to buffer things and only output log lines when newlines
-are seen. Let's use a slghtly better implementation of ``LoggerWriter``:
+are seen. Let's use a slightly better implementation of ``LoggerWriter``:
.. code-block:: python
.. class:: AnnAssign(target, annotation, value, simple)
An assignment with a type annotation. ``target`` is a single node and can
- be a :class:`Name`, a :class:`Attribute` or a :class:`Subscript`.
+ be a :class:`Name`, an :class:`Attribute` or a :class:`Subscript`.
``annotation`` is the annotation, such as a :class:`Constant` or :class:`Name`
node. ``value`` is a single optional node.
YieldFrom(value)
A ``yield`` or ``yield from`` expression. Because these are expressions, they
- must be wrapped in a :class:`Expr` node if the value sent back is not used.
+ must be wrapped in an :class:`Expr` node if the value sent back is not used.
.. doctest::
a :exc:`CancelledError` exception.
If the Future's result isn't yet available, this method raises
- a :exc:`InvalidStateError` exception.
+ an :exc:`InvalidStateError` exception.
.. method:: set_result(result)
Mark the Future as *done* and set its result.
- Raises a :exc:`InvalidStateError` error if the Future is
+ Raises an :exc:`InvalidStateError` error if the Future is
already *done*.
.. method:: set_exception(exception)
Mark the Future as *done* and set an exception.
- Raises a :exc:`InvalidStateError` error if the Future is
+ Raises an :exc:`InvalidStateError` error if the Future is
already *done*.
.. method:: done()
a :exc:`CancelledError` exception.
If the Task's result isn't yet available, this method raises
- a :exc:`InvalidStateError` exception.
+ an :exc:`InvalidStateError` exception.
.. method:: exception()
.. versionchanged:: 3.12
``suppress`` now supports suppressing exceptions raised as
- part of an :exc:`BaseExceptionGroup`.
+ part of a :exc:`BaseExceptionGroup`.
.. function:: redirect_stdout(new_target)
Note that win32 system dlls like ``kernel32`` and ``user32`` often export ANSI
as well as UNICODE versions of a function. The UNICODE version is exported with
-an ``W`` appended to the name, while the ANSI version is exported with an ``A``
+a ``W`` appended to the name, while the ANSI version is exported with an ``A``
appended to the name. The win32 ``GetModuleHandle`` function, which returns a
*module handle* for a given module name, has the following C prototype, and a
macro is used to expose one of them as ``GetModuleHandle`` depending on whether
.. versionchanged:: 3.9
The :func:`math.gcd` function is now used to normalize the *numerator*
- and *denominator*. :func:`math.gcd` always return a :class:`int` type.
+ and *denominator*. :func:`math.gcd` always returns an :class:`int` type.
Previously, the GCD type depended on *numerator* and *denominator*.
.. versionchanged:: 3.11
If the request was mapped to a file, it is opened. Any :exc:`OSError`
exception in opening the requested file is mapped to a ``404``,
- ``'File not found'`` error. If there was a ``'If-Modified-Since'``
+ ``'File not found'`` error. If there was an ``'If-Modified-Since'``
header in the request, and the file was not modified after this time,
a ``304``, ``'Not Modified'`` response is sent. Otherwise, the content
type is guessed by calling the :meth:`guess_type` method, which in turn
something like a data file that lives next to the ``__init__.py``
file of the package. The purpose of this class is to help abstract
out the accessing of such data files so that it does not matter if
- the package and its data file(s) are stored in a e.g. zip file
+ the package and its data file(s) are stored e.g. in a zip file
versus on the file system.
For any of methods of this class, a *resource* argument is
something like a data file that lives next to the ``__init__.py``
file of the package. The purpose of this class is to help abstract
out the accessing of such data files so that it does not matter if
- the package and its data file(s) are stored in a e.g. zip file
+ the package and its data file(s) are stored e.g. in a zip file
versus on the file system.
For any of methods of this class, a *resource* argument is
.. versionchanged:: 3.8
Functions wrapped in :func:`functools.partial` now return ``True`` if the
- wrapped function is a :term:`asynchronous generator` function.
+ wrapped function is an :term:`asynchronous generator` function.
.. versionchanged:: 3.13
Functions wrapped in :func:`functools.partialmethod` now return ``True``
.. attribute:: Parameter.kind.description
- Describes a enum value of :attr:`Parameter.kind`.
+ Describes an enum value of :attr:`Parameter.kind`.
.. versionadded:: 3.8
.. method:: get_visible()
- Return an :class:`Message` instance whose headers are the message's
+ Return a :class:`Message` instance whose headers are the message's
visible headers and whose body is empty.
the list of arguments to process (default: ``sys.argv[1:]``)
``values``
- an :class:`Values` object to store option arguments in (default: a
+ a :class:`Values` object to store option arguments in (default: a
new instance of :class:`Values`) -- if you give an existing object, the
option defaults will not be initialized on it
.. function:: pwritev(fd, buffers, offset, flags=0, /)
- Write the *buffers* contents to file descriptor *fd* at a offset *offset*,
+ Write the *buffers* contents to file descriptor *fd* at an offset *offset*,
leaving the file offset unchanged. *buffers* must be a sequence of
:term:`bytes-like objects <bytes-like object>`. Buffers are processed in
array order. Entire contents of the first buffer is written before
new file descriptor is :ref:`non-inheritable <fd_inheritance>`.
*initval* is the initial value of the event counter. The initial value
- must be an 32 bit unsigned integer. Please note that the initial value is
+ must be a 32 bit unsigned integer. Please note that the initial value is
limited to a 32 bit unsigned int although the event counter is an unsigned
64 bit integer with a maximum value of 2\ :sup:`64`\ -\ 2.
.. data:: EFD_SEMAPHORE
- Provide semaphore-like semantics for reads from a :func:`eventfd` file
+ Provide semaphore-like semantics for reads from an :func:`eventfd` file
descriptor. On read the internal counter is decremented by one.
.. availability:: Linux >= 2.6.30
.. method:: Path.stat(*, follow_symlinks=True)
- Return a :class:`os.stat_result` object containing information about this path, like :func:`os.stat`.
+ Return an :class:`os.stat_result` object containing information about this path, like :func:`os.stat`.
The result is looked up at each call to this method.
This method normally follows symlinks; to stat a symlink add the argument
when a key of a dictionary is not a string, otherwise such keys are skipped.
When *aware_datetime* is true and any field with type ``datetime.datetime``
- is set as a :ref:`aware object <datetime-naive-aware>`, it will convert to
+ is set as an :ref:`aware object <datetime-naive-aware>`, it will convert to
UTC timezone before writing it.
A :exc:`TypeError` will be raised if the object is of an unsupported type or
IDN-encoded internationalized domain name, the *server_name_callback*
receives a decoded U-label (``"pythön.org"``).
- If there is an decoding error on the server name, the TLS connection will
+ If there is a decoding error on the server name, the TLS connection will
terminate with an :const:`ALERT_DESCRIPTION_INTERNAL_ERROR` fatal TLS
alert message to the client.
.. data:: NORMAL_PRIORITY_CLASS
A :class:`Popen` ``creationflags`` parameter to specify that a new process
- will have an normal priority. (default)
+ will have a normal priority. (default)
.. versionadded:: 3.7
.. versionchanged:: 3.2
This method is applicable only for local hostnames. When a remote
- hostname is given, an :exc:`~urllib.error.URLError` is raised.
+ hostname is given, a :exc:`~urllib.error.URLError` is raised.
.. _data-handler-objects:
ignores white spaces in base64 encoded data URLs so the URL may be wrapped
in whatever source file it comes from. But even though some browsers don't
mind about a missing padding at the end of a base64 encoded data URL, this
- implementation will raise an :exc:`ValueError` in that case.
+ implementation will raise a :exc:`ValueError` in that case.
.. _ftp-handler-objects:
The minimum supported iOS version is specified at compile time, using the
:option:`--host` option to ``configure``. By default, when compiled for iOS,
Python will be compiled with a minimum supported iOS version of 13.0. To use a
-different miniumum iOS version, provide the version number as part of the
+different minimum iOS version, provide the version number as part of the
:option:`!--host` argument - for example,
``--host=arm64-apple-ios15.4-simulator`` would compile an ARM64 simulator build
with a deployment target of 15.4.