8000 Catch up with justin · python/cpython@5137145 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5137145

Browse files
committed
Catch up with justin
2 parents cd05c17 + 241ce0f commit 5137145

File tree

186 files changed

+3671
-959
lines changed
  • _testcapi
  • _testinternalcapi
  • cjkcodecs/clinic
  • clinic
  • Objects
  • PCbuild
  • PC
  • Python
  • Tools
  • Some content is hidden

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

    186 files changed

    +3671
    -959
    lines changed

    Doc/c-api/unicode.rst

    Lines changed: 0 additions & 8 deletions
    Original file line numberDiff line numberDiff line change
    @@ -992,19 +992,11 @@ These are the UTF-8 codec APIs:
    992992
    993993
    As :c:func:`PyUnicode_AsUTF8AndSize`, but does not store the size.
    994994
    995-
    Raise an exception if the *unicode* string contains embedded null
    996-
    characters. To accept embedded null characters and truncate on purpose
    997-
    at the first null byte, ``PyUnicode_AsUTF8AndSize(unicode, NULL)`` can be
    998-
    used instead.
    999-
    1000995
    .. versionadded:: 3.3
    1001996
    1002997
    .. versionchanged:: 3.7
    1003998
    The return type is now ``const char *`` rather of ``char *``.
    1004999
    1005-
    .. versionchanged:: 3.13
    1006-
    Raise an exception if the string contains embedded null characters.
    1007-
    10081000
    10091001
    UTF-32 Codecs
    10101002
    """""""""""""

    Doc/data/stable_abi.dat

    Lines changed: 0 additions & 1 deletion
    Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

    Doc/glossary.rst

    Lines changed: 7 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -1138,6 +1138,11 @@ Glossary
    11381138
    an :term:`expression` or one of several constructs with a keyword, such
    11391139
    as :keyword:`if`, :keyword:`while` or :keyword:`for`.
    11401140

    1141+
    static type checker
    1142+
    An external tool that reads Python code and analyzes it, looking for
    1143+
    issues such as incorrect types. See also :term:`type hints <type hint>`
    1144+
    and the :mod:`typing` module.
    1145+
    11411146
    strong reference
    11421147
    In Python's C API, a strong reference is a reference to an object
    11431148
    which is owned by the code holding the reference. The strong
    @@ -1214,8 +1219,8 @@ Glossary
    12141219
    attribute, or a function parameter or return value.
    12151220

    12161221
    Type hints are optional and are not enforced by Python but
    1217-
    they are useful to static type analysis tools, and aid IDEs with code
    1218-
    completion and refactoring.
    1222+
    they are useful to :term:`static type checkers <static type checker>`.
    1223+
    They can also aid IDEs with code completion and refactoring.
    12191224

    12201225
    Type hints of global variables, class attributes, and functions,
    12211226
    but not local variables, can be accessed using

    Doc/howto/enum.rst

    Lines changed: 6 additions & 6 deletions
    Original file line numberDiff line numberDiff line change
    @@ -607,9 +607,9 @@ The complete signature is::
    607607
    start=1,
    608608
    )
    609609

    610-
    :value: What the new enum class will record as its name.
    610+
    * *value*: What the new enum class will record as its name.
    611611

    612-
    :names: The enum members. This can be a whitespace- or comma-separated string
    612+
    * *names*: The enum members. This can be a whitespace- or comma-separated string
    613613
    (values will start at 1 unless otherwise specified)::
    614614

    615615
    'RED GREEN BLUE' | 'RED,GREEN,BLUE' | 'RED, GREEN, BLUE'
    @@ -626,13 +626,13 @@ The complete signature is::
    626626

    627627
    {'CHARTREUSE': 7, 'SEA_GREEN': 11, 'ROSEMARY': 42}
    628628

    629-
    :module: name of module where new enum class can be found.
    629+
    * *module*: name of module where new enum class can be found.
    630630

    631-
    :qualname: where in module new enum class can be found.
    631+
    * *qualname*: where in module new enum class can be found.
    632632

    633-
    :type: type to mix in to new enum class.
    633+
    * *type*: type to mix in to new enum class.
    634634

    635-
    :start: number to start counting at if only names are passed in.
    635+
    * *start*: number to start counting at if only names are passed in.
    636636

    637637
    .. versionchanged:: 3.5
    638638
    The *start* parameter was added.

    Doc/howto/pyporting.rst

    Lines changed: 3 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -39,7 +39,8 @@ are:
    3939
    #. Once your dependencies are no longer blocking you, use continuous integration
    4040
    to make sure you stay compatible with Python 2 and 3 (tox_ can help test
    4141
    against multiple versions of Python; ``python -m pip install tox``)
    42-
    #. Consider using optional static type checking to make sure your type usage
    42+
    #. Consider using optional :term:`static type checking <static type checker>`
    43+
    to make sure your type usage
    4344
    works in both Python 2 and 3 (e.g. use mypy_ to check your typing under both
    4445
    Python 2 and Python 3; ``python -m pip install mypy``).
    4546

    @@ -395,7 +396,7 @@ comparisons occur, making the mistake much easier to track down.
    395396
    Consider using optional static type checking
    396397
    --------------------------------------------
    397398

    398-
    Another way to help port your code is to use a static type checker like
    399+
    Another way to help port your code is to use a :term:`static type checker` like
    399400
    mypy_ or pytype_ on your code. These tools can be used to analyze your code as
    400401
    if it's being run under Python 2, then you can run the tool a second time as if
    401402
    your code is running under Python 3. By running a static type checker twice like

    Doc/library/_thread.rst

    Lines changed: 4 additions & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -120,10 +120,13 @@ This module defines the following constants and functions:
    120120
    Its value may be used to uniquely identify this particular thread system-wide
    121121
    (until the thread terminates, after which the value may be recycled by the OS).
    122122

    123-
    .. availability:: Windows, FreeBSD, Linux, macOS, OpenBSD, NetBSD, AIX, DragonFlyBSD.
    123+
    .. availability:: Windows, FreeBSD, Linux, macOS, OpenBSD, NetBSD, AIX, DragonFlyBSD, GNU/kFreeBSD.
    124124

    125125
    .. versionadded:: 3.8
    126126

    127+
    .. versionchanged:: 3.13
    128+
    Added support for GNU/kFreeBSD.
    129+
    127130

    128131
    .. function:: stack_size([size])
    129132

    Doc/library/asyncio-eventloop.rst

    Lines changed: 9 additions & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -778,7 +778,7 @@ Creating network servers
    778778
    *, sock=None, backlog=100, ssl=None, \
    779779
    ssl_handshake_timeout=None, \
    780780
    ssl_shutdown_timeout=None, \
    781-
    start_serving=True)
    781+
    start_serving=True, cleanup_socket=True)
    782782
    783783
    Similar to :meth:`loop.create_server` but works with the
    784784
    :py:const:`~socket.AF_UNIX` socket family.
    @@ -788,6 +788,10 @@ Creating network servers
    788788
    :class:`str`, :class:`bytes`, and :class:`~pathlib.Path` paths
    789789
    are supported.
    790790

    791+
    If *cleanup_socket* is True then the Unix socket will automatically
    792+
    be removed from the filesystem when the server is closed, unless the
    793+
    socket has been replaced after the server has been created.
    794+
    791795
    See the documentation of the :meth:`loop.create_server` method
    792796
    for information about arguments to this method.
    793797

    @@ -802,6 +806,10 @@ Creating network servers
    802806

    803807
    Added the *ssl_shutdown_timeout* parameter.
    804808

    809+
    .. versionchanged:: 3.13
    810+
    811+
    Added the *cleanup_socket* parameter.
    812+
    805813

    806814
    .. coroutinemethod:: loop.connect_accepted_socket(protocol_factory, \
    807815
    sock, *, ssl=None, ssl_handshake_timeout=None, \

    Doc/library/contextlib.rst

    Lines changed: 3 additions & 3 deletions
    Original file line numberDiff line numberDiff line change
    @@ -304,15 +304,15 @@ Functions and classes provided:
    304304

    305305
    This context manager is :ref:`reentrant <reentrant-cms>`.
    306306

    307-
    If the code within the :keyword:`!with` block raises an
    308-
    :exc:`ExceptionGroup`, suppressed exceptions are removed from the
    307+
    If the code within the :keyword:`!with` block raises a
    308+
    :exc:`BaseExceptionGroup`, suppressed exceptions are removed from the
    309309
    group. If any exceptions in the group are not suppressed, a group containing them is re-raised.
    310310

    311311
    .. versionadded:: 3.4
    312312

    313313
    .. versionchanged:: 3.12
    314314
    ``suppress`` now supports suppressing exceptions raised as
    315-
    part of an :exc:`ExceptionGroup`.
    315+
    part of an :exc:`BaseExceptionGroup`.
    316316

    317317
    .. function:: redirect_stdout(new_target)
    318318

    Doc/library/datetime.rst

    Lines changed: 2 additions & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -38,7 +38,8 @@ on efficient attribute extraction for output formatting and manipulation.
    3838
    Third-party library with expanded time zone and parsing support.
    3939

    4040
    Package `DateType <https://pypi.org/project/datetype/>`_
    41-
    Third-party library that introduces distinct static types to e.g. allow static type checkers
    41+
    Third-party library that introduces distinct static types to e.g. allow
    42+
    :term:`static type checkers <static type checker>`
    4243
    to differentiate between naive and aware datetimes.
    4344

    4445
    .. _datetime-naive-aware:

    Doc/library/mmap.rst

    Lines changed: 8 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -285,6 +285,14 @@ To map anonymous memory, -1 should be passed as the fileno along with the length
    285285
    values are ``os.SEEK_CUR`` or ``1`` (seek relative to the current
    286286
    position) and ``os.SEEK_END`` or ``2`` (seek relative to the file's end).
    287287

    288+
    .. versionchanged:: 3.13
    289+
    Return the new absolute position instead of ``None``.
    290+
    291+
    .. method:: seekable()
    292+
    293+
    Return whether the file supports seeking, and the return value is always ``True``.
    294+
    295+
    .. versionadded:: 3.13
    288296

    289297
    .. method:: size()
    290298

    0 commit comments

    Comments
     (0)
    0