mirror of
https://github.com/python/cpython.git
synced 2025-07-29 06:05:00 +00:00
[3.10] [doc] Fix typos found using codespell (GH-28744) (GH-28758)
This commit is contained in:
parent
325e4647af
commit
d15f47d179
12 changed files with 16 additions and 16 deletions
|
@ -185,7 +185,7 @@ Object Calling API
|
|||
Various functions are available for calling a Python object.
|
||||
Each converts its arguments to a convention supported by the called object –
|
||||
either *tp_call* or vectorcall.
|
||||
In order to do as litle conversion as possible, pick one that best fits
|
||||
In order to do as little conversion as possible, pick one that best fits
|
||||
the format of data you have available.
|
||||
|
||||
The following table summarizes the available functions;
|
||||
|
|
|
@ -22,7 +22,7 @@ There are two kinds of configuration:
|
|||
* The :ref:`Isolated Configuration <init-isolated-conf>` can be used to embed
|
||||
Python into an application. It isolates Python from the system. For example,
|
||||
environments variables are ignored, the LC_CTYPE locale is left unchanged and
|
||||
no signal handler is registred.
|
||||
no signal handler is registered.
|
||||
|
||||
The :c:func:`Py_RunMain` function can be used to write a customized Python
|
||||
program.
|
||||
|
@ -696,7 +696,7 @@ PyConfig
|
|||
* Otherwise, use the :term:`locale encoding`:
|
||||
``nl_langinfo(CODESET)`` result.
|
||||
|
||||
At Python statup, the encoding name is normalized to the Python codec
|
||||
At Python startup, the encoding name is normalized to the Python codec
|
||||
name. For example, ``"ANSI_X3.4-1968"`` is replaced with ``"ascii"``.
|
||||
|
||||
See also the :c:member:`~PyConfig.filesystem_errors` member.
|
||||
|
|
|
@ -714,7 +714,7 @@ Why don't generators support the with statement?
|
|||
For technical reasons, a generator used directly as a context manager
|
||||
would not work correctly. When, as is most common, a generator is used as
|
||||
an iterator run to completion, no closing is needed. When it is, wrap
|
||||
it as "contextlib.closing(generator)" in the 'with' statment.
|
||||
it as "contextlib.closing(generator)" in the 'with' statement.
|
||||
|
||||
|
||||
Why are colons required for the if/while/def/class statements?
|
||||
|
|
|
@ -1920,7 +1920,7 @@ and classes for traversing abstract syntax trees:
|
|||
If source contains a null character ('\0'), :exc:`ValueError` is raised.
|
||||
|
||||
.. warning::
|
||||
Note that succesfully parsing souce code into an AST object doesn't
|
||||
Note that successfully parsing source code into an AST object doesn't
|
||||
guarantee that the source code provided is valid Python code that can
|
||||
be executed as the compilation step can raise further :exc:`SyntaxError`
|
||||
exceptions. For instance, the source ``return 42`` generates a valid
|
||||
|
|
|
@ -152,7 +152,7 @@ The modern interface provides:
|
|||
This version does not allow the digit 0 (zero) to the letter O (oh) and digit
|
||||
1 (one) to either the letter I (eye) or letter L (el) mappings, all these
|
||||
characters are included in the Extended Hex Alphabet and are not
|
||||
interchangable.
|
||||
interchangeable.
|
||||
|
||||
.. versionadded:: 3.10
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ You can control how files are opened by providing an opening hook via the
|
|||
*openhook* parameter to :func:`fileinput.input` or :class:`FileInput()`. The
|
||||
hook must be a function that takes two arguments, *filename* and *mode*, and
|
||||
returns an accordingly opened file-like object. If *encoding* and/or *errors*
|
||||
are specified, they will be passed to the hook as aditional keyword arguments.
|
||||
are specified, they will be passed to the hook as additional keyword arguments.
|
||||
This module provides a :func:`hook_compressed` to support compressed files.
|
||||
|
||||
The following function is the primary interface of this module:
|
||||
|
|
|
@ -255,7 +255,7 @@ function::
|
|||
Package distributions
|
||||
---------------------
|
||||
|
||||
A convience method to resolve the distribution or
|
||||
A convenience method to resolve the distribution or
|
||||
distributions (in the case of a namespace package) for top-level
|
||||
Python packages or modules::
|
||||
|
||||
|
|
|
@ -1249,7 +1249,7 @@ The :mod:`test.support.threading_helper` module provides support for threading t
|
|||
Context manager catching :class:`threading.Thread` exception using
|
||||
:func:`threading.excepthook`.
|
||||
|
||||
Attributes set when an exception is catched:
|
||||
Attributes set when an exception is caught:
|
||||
|
||||
* ``exc_type``
|
||||
* ``exc_value``
|
||||
|
@ -1458,7 +1458,7 @@ The :mod:`test.support.os_helper` module provides support for os tests.
|
|||
.. function:: unlink(filename)
|
||||
|
||||
Call :func:`os.unlink` on *filename*. On Windows platforms, this is
|
||||
wrapped with a wait loop that checks for the existence fo the file.
|
||||
wrapped with a wait loop that checks for the existence of the file.
|
||||
|
||||
|
||||
:mod:`test.support.import_helper` --- Utilities for import tests
|
||||
|
|
|
@ -243,7 +243,7 @@ Standard names are defined for the following types:
|
|||
|
||||
.. note::
|
||||
A future version of Python may stop setting this attribute by default.
|
||||
To guard against this potential change, preferrably read from the
|
||||
To guard against this potential change, preferably read from the
|
||||
:attr:`__spec__` attribute instead or use
|
||||
``getattr(module, "__loader__", None)`` if you explicitly need to use
|
||||
this attribute.
|
||||
|
@ -268,7 +268,7 @@ Standard names are defined for the following types:
|
|||
|
||||
.. note::
|
||||
A future version of Python may stop setting this attribute by default.
|
||||
To guard against this potential change, preferrably read from the
|
||||
To guard against this potential change, preferably read from the
|
||||
:attr:`__spec__` attribute instead or use
|
||||
``getattr(module, "__package__", None)`` if you explicitly need to use
|
||||
this attribute.
|
||||
|
|
|
@ -165,7 +165,7 @@ def hide_comments(lines):
|
|||
"""Tool to remove comments from given lines.
|
||||
|
||||
It yields empty lines in place of comments, so line numbers are
|
||||
still meaningfull.
|
||||
still meaningful.
|
||||
"""
|
||||
in_multiline_comment = False
|
||||
for line in lines:
|
||||
|
|
|
@ -550,7 +550,7 @@ Built-in modules have no ``__file__`` attribute::
|
|||
File "<stdin>", line 1, in <module>
|
||||
AttributeError: module 'sys' has no attribute '__file__'
|
||||
|
||||
Other C extensins are built as dynamic libraires, like the ``_asyncio`` module.
|
||||
Other C extensins are built as dynamic libraries, like the ``_asyncio`` module.
|
||||
They are built with the ``Py_BUILD_CORE_MODULE`` macro defined.
|
||||
Example on Linux x86-64::
|
||||
|
||||
|
|
|
@ -1579,7 +1579,7 @@ Deprecated
|
|||
|
||||
* Currently Python accepts numeric literals immediately followed by keywords,
|
||||
for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing
|
||||
and ambigious expressions like ``[0x1for x in y]`` (which can be
|
||||
and ambiguous expressions like ``[0x1for x in y]`` (which can be
|
||||
interpreted as ``[0x1 for x in y]`` or ``[0x1f or x in y]``). Starting in
|
||||
this release, a deprecation warning is raised if the numeric literal is
|
||||
immediately followed by one of keywords :keyword:`and`, :keyword:`else`,
|
||||
|
@ -1916,7 +1916,7 @@ Changes in the Python API
|
|||
if the *globals* dictionary has no ``"__builtins__"`` key, rather than using
|
||||
``{"None": None}`` as builtins: same behavior as :func:`eval` and
|
||||
:func:`exec` functions. Defining a function with ``def function(...): ...``
|
||||
in Python is not affected, globals cannot be overriden with this syntax: it
|
||||
in Python is not affected, globals cannot be overridden with this syntax: it
|
||||
also inherits the current builtins.
|
||||
(Contributed by Victor Stinner in :issue:`42990`.)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue