From 2095566cc39d1045605fff44bcce91ad6d5a18c0 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 5 Oct 2021 22:13:05 +0200 Subject: [PATCH 1/4] Fix typos in the Doc directory --- Doc/c-api/call.rst | 2 +- Doc/c-api/init_config.rst | 4 ++-- Doc/faq/design.rst | 2 +- Doc/library/ast.rst | 2 +- Doc/library/base64.rst | 2 +- Doc/library/crypt.rst | 2 +- Doc/library/curses.rst | 2 +- Doc/library/dis.rst | 2 +- Doc/library/enum.rst | 4 ++-- Doc/library/fileinput.rst | 2 +- Doc/library/importlib.metadata.rst | 2 +- Doc/library/test.rst | 4 ++-- Doc/library/types.rst | 4 ++-- Doc/reference/import.rst | 2 +- Doc/tools/rstlint.py | 2 +- Doc/using/cmdline.rst | 4 ++-- Doc/using/configure.rst | 2 +- Doc/whatsnew/3.10.rst | 4 ++-- 18 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Doc/c-api/call.rst b/Doc/c-api/call.rst index 31dc9c8031fdb6d..739b5e97d15150d 100644 --- a/Doc/c-api/call.rst +++ b/Doc/c-api/call.rst @@ -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; diff --git a/Doc/c-api/init_config.rst b/Doc/c-api/init_config.rst index 2e52679ebc5b5de..989660caeda06ea 100644 --- a/Doc/c-api/init_config.rst +++ b/Doc/c-api/init_config.rst @@ -22,7 +22,7 @@ There are two kinds of configuration: * The :ref:`Isolated Configuration ` 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. @@ -706,7 +706,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. diff --git a/Doc/faq/design.rst b/Doc/faq/design.rst index 720b1e496eb8482..0437b59d55da6e0 100644 --- a/Doc/faq/design.rst +++ b/Doc/faq/design.rst @@ -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? diff --git a/Doc/library/ast.rst b/Doc/library/ast.rst index d84c841fa4a08e5..e29b5e88d71d412 100644 --- a/Doc/library/ast.rst +++ b/Doc/library/ast.rst @@ -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 diff --git a/Doc/library/base64.rst b/Doc/library/base64.rst index 29e52ad48e11591..4ff038c8d29f1a3 100644 --- a/Doc/library/base64.rst +++ b/Doc/library/base64.rst @@ -154,7 +154,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 diff --git a/Doc/library/crypt.rst b/Doc/library/crypt.rst index d25c626a175854a..507891daa129bb4 100644 --- a/Doc/library/crypt.rst +++ b/Doc/library/crypt.rst @@ -111,7 +111,7 @@ The :mod:`crypt` module defines the following functions: .. index:: single: crypt(3) Since a few :manpage:`crypt(3)` extensions allow different values, with - different sizes in the *salt*, it is recommended to use the full crypted + different sizes in the *salt*, it is recommended to use the full encrypted password as salt when checking for a password. .. versionchanged:: 3.3 diff --git a/Doc/library/curses.rst b/Doc/library/curses.rst index 37e822c0e2b2079..ce8d3f50e935499 100644 --- a/Doc/library/curses.rst +++ b/Doc/library/curses.rst @@ -936,7 +936,7 @@ the following methods and attributes: .. method:: window.getbegyx() - Return a tuple ``(y, x)`` of co-ordinates of upper-left corner. + Return a tuple ``(y, x)`` of coordinates of upper-left corner. .. method:: window.getbkgd() diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 9b683083f6b622f..9958dea5587f171 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -725,7 +725,7 @@ iterations of the loop. of the stack and sets the ``f_lasti`` attribute of the frame with that value. Then pops the next exception from the stack uses it to restore the current exception. Finally it re-raises the originally popped exception. - Used in excpetion handler cleanup. + Used in exception handler cleanup. .. versionadded:: 3.11 diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst index f28505a6d2ccf8c..86bf705af77e71b 100644 --- a/Doc/library/enum.rst +++ b/Doc/library/enum.rst @@ -651,8 +651,8 @@ Data Types --------------- -Utilites and Decorators ------------------------ +Utilities and Decorators +------------------------ .. class:: auto diff --git a/Doc/library/fileinput.rst b/Doc/library/fileinput.rst index ae31341a9e63ee6..2a2c1b3c2b921c3 100644 --- a/Doc/library/fileinput.rst +++ b/Doc/library/fileinput.rst @@ -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: diff --git a/Doc/library/importlib.metadata.rst b/Doc/library/importlib.metadata.rst index c43457a3850678c..58c582d71241377 100644 --- a/Doc/library/importlib.metadata.rst +++ b/Doc/library/importlib.metadata.rst @@ -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:: diff --git a/Doc/library/test.rst b/Doc/library/test.rst index a6cc2be4d552228..a8dc35476fc9bdc 100644 --- a/Doc/library/test.rst +++ b/Doc/library/test.rst @@ -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 diff --git a/Doc/library/types.rst b/Doc/library/types.rst index 88fe47a8d4a7fbf..2314b02c7449c0b 100644 --- a/Doc/library/types.rst +++ b/Doc/library/types.rst @@ -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. diff --git a/Doc/reference/import.rst b/Doc/reference/import.rst index 39fcba015b69475..69e2a9472744978 100644 --- a/Doc/reference/import.rst +++ b/Doc/reference/import.rst @@ -605,7 +605,7 @@ the module. ``__file__`` is optional (if set, value must be a string). It indicates the pathname of the file from which the module was loaded (if - loaded from a file), or the pathname of the shared libray file + loaded from a file), or the pathname of the shared library file for extension modules loaded dynamically from a shared library. It might be missing for certain types of modules, such as C modules that are statically linked into the interpreter, and the diff --git a/Doc/tools/rstlint.py b/Doc/tools/rstlint.py index 91aed80b1e9a6cd..045b7d7c945df52 100755 --- a/Doc/tools/rstlint.py +++ b/Doc/tools/rstlint.py @@ -256,7 +256,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: diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst index b42518e8731ca8b..23a645a036aedf3 100644 --- a/Doc/using/cmdline.rst +++ b/Doc/using/cmdline.rst @@ -477,7 +477,7 @@ Miscellaneous options * ``-X no_debug_ranges`` disables the inclusion of the tables mapping extra location information (end line, start column offset and end column offset) to every instruction in code objects. This is useful when smaller code - objects and pyc files are desired as well as supressing the extra visual + objects and pyc files are desired as well as suppressing the extra visual location indicators when the interpreter displays tracebacks. See also :envvar:`PYTHONNODEBUGRANGES`. * ``-X frozen_modules`` determines whether or not frozen modules are @@ -959,7 +959,7 @@ conflict. If this variable is set, it disables the inclusion of the tables mapping extra location information (end line, start column offset and end column offset) to every instruction in code objects. This is useful when smaller - code objects and pyc files are desired as well as supressing the extra visual + code objects and pyc files are desired as well as suppressing the extra visual location indicators when the interpreter displays tracebacks. .. versionadded:: 3.11 diff --git a/Doc/using/configure.rst b/Doc/using/configure.rst index a545d5a9372ac01..a59bee4ccf0f6ee 100644 --- a/Doc/using/configure.rst +++ b/Doc/using/configure.rst @@ -553,7 +553,7 @@ Built-in modules have no ``__file__`` attribute:: File "", line 1, in AttributeError: module 'sys' has no attribute '__file__' -Other C extensions are built as dynamic libraires, like the ``_asyncio`` module. +Other C extensions 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:: diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index de25d158bd54af2..b063255bc3e9e4f 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -1583,7 +1583,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`, @@ -1920,7 +1920,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`.) From d0805f07847ba29fd703603ff8486f9700e5bdcd Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 5 Oct 2021 22:38:33 +0200 Subject: [PATCH 2/4] Update Doc/library/curses.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Łukasz Langa --- Doc/library/curses.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/curses.rst b/Doc/library/curses.rst index ce8d3f50e935499..37e822c0e2b2079 100644 --- a/Doc/library/curses.rst +++ b/Doc/library/curses.rst @@ -936,7 +936,7 @@ the following methods and attributes: .. method:: window.getbegyx() - Return a tuple ``(y, x)`` of coordinates of upper-left corner. + Return a tuple ``(y, x)`` of co-ordinates of upper-left corner. .. method:: window.getbkgd() From 6cf8c625c795df76f828a598d7b3f69e33e3f2f1 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 5 Oct 2021 23:10:34 +0200 Subject: [PATCH 3/4] fixup! crypted --- Doc/library/crypt.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/crypt.rst b/Doc/library/crypt.rst index 507891daa129bb4..fe13683f695d1b5 100644 --- a/Doc/library/crypt.rst +++ b/Doc/library/crypt.rst @@ -111,7 +111,7 @@ The :mod:`crypt` module defines the following functions: .. index:: single: crypt(3) Since a few :manpage:`crypt(3)` extensions allow different values, with - different sizes in the *salt*, it is recommended to use the full encrypted + different sizes in the *salt*, it is recommended to use the full crypted password as salt when checking for a password. .. versionchanged:: 3.3 From 08025126cc7a9625579b3a85f9248fc89246b453 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 5 Oct 2021 23:21:06 +0200 Subject: [PATCH 4/4] fixup! Revert all changes to crypt.rst --- Doc/library/crypt.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/crypt.rst b/Doc/library/crypt.rst index fe13683f695d1b5..d25c626a175854a 100644 --- a/Doc/library/crypt.rst +++ b/Doc/library/crypt.rst @@ -111,7 +111,7 @@ The :mod:`crypt` module defines the following functions: .. index:: single: crypt(3) Since a few :manpage:`crypt(3)` extensions allow different values, with - different sizes in the *salt*, it is recommended to use the full crypted + different sizes in the *salt*, it is recommended to use the full crypted password as salt when checking for a password. .. versionchanged:: 3.3