Skip to content

Commit aef6de6

Browse files
authored
Merge branch 'main' into bpo-28879
2 parents 5ffc098 + 800d37f commit aef6de6

35 files changed

+350
-74
lines changed

Doc/c-api/memory.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,10 @@ This allocator is disabled if Python is configured with the
672672
:option:`--without-pymalloc` option. It can also be disabled at runtime using
673673
the :envvar:`PYTHONMALLOC` environment variable (ex: ``PYTHONMALLOC=malloc``).
674674
675+
Typically, it makes sense to disable the pymalloc allocator when building
676+
Python with AddressSanitizer (:option:`--with-address-sanitizer`) which helps
677+
uncover low level bugs within the C code.
678+
675679
Customize pymalloc Arena Allocator
676680
----------------------------------
677681

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Pending removal in Python 3.15
4545

4646
* :mod:`pathlib`:
4747

48-
* :meth:`.PurePath.is_reserved`
48+
* :meth:`!.PurePath.is_reserved`
4949
has been deprecated since Python 3.13.
5050
Use :func:`os.path.isreserved` to detect reserved paths on Windows.
5151

Doc/library/argparse.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,12 +434,18 @@ arguments they contain. For example::
434434
>>> parser.parse_args(['-f', 'foo', '@args.txt'])
435435
Namespace(f='bar')
436436

437-
Arguments read from a file must by default be one per line (but see also
437+
Arguments read from a file must be one per line by default (but see also
438438
:meth:`~ArgumentParser.convert_arg_line_to_args`) and are treated as if they
439439
were in the same place as the original file referencing argument on the command
440440
line. So in the example above, the expression ``['-f', 'foo', '@args.txt']``
441441
is considered equivalent to the expression ``['-f', 'foo', '-f', 'bar']``.
442442

443+
.. note::
444+
445+
Empty lines are treated as empty strings (``''``), which are allowed as values but
446+
not as arguments. Empty lines that are read as arguments will result in an
447+
"unrecognized arguments" error.
448+
443449
:class:`ArgumentParser` uses :term:`filesystem encoding and error handler`
444450
to read the file containing arguments.
445451

Doc/library/ctypes.rst

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,24 @@ Fundamental data types
232232
+----------------------+------------------------------------------+----------------------------+
233233
| :class:`c_int` | :c:expr:`int` | int |
234234
+----------------------+------------------------------------------+----------------------------+
235+
| :class:`c_int8` | :c:type:`int8_t` | int |
236+
+----------------------+------------------------------------------+----------------------------+
237+
| :class:`c_int16` | :c:type:`int16_t` | int |
238+
+----------------------+------------------------------------------+----------------------------+
239+
| :class:`c_int32` | :c:type:`int32_t` | int |
240+
+----------------------+------------------------------------------+----------------------------+
241+
| :class:`c_int64` | :c:type:`int64_t` | int |
242+
+----------------------+------------------------------------------+----------------------------+
235243
| :class:`c_uint` | :c:expr:`unsigned int` | int |
236244
+----------------------+------------------------------------------+----------------------------+
245+
| :class:`c_uint8` | :c:type:`uint8_t` | int |
246+
+----------------------+------------------------------------------+----------------------------+
247+
| :class:`c_uint16` | :c:type:`uint16_t` | int |
248+
+----------------------+------------------------------------------+----------------------------+
249+
| :class:`c_uint32` | :c:type:`uint32_t` | int |
250+
+----------------------+------------------------------------------+----------------------------+
251+
| :class:`c_uint64` | :c:type:`uint64_t` | int |
252+
+----------------------+------------------------------------------+----------------------------+
237253
| :class:`c_long` | :c:expr:`long` | int |
238254
+----------------------+------------------------------------------+----------------------------+
239255
| :class:`c_ulong` | :c:expr:`unsigned long` | int |
@@ -2524,7 +2540,7 @@ These are the fundamental ctypes data types:
25242540

25252541
.. class:: c_int8
25262542

2527-
Represents the C 8-bit :c:expr:`signed int` datatype. Usually an alias for
2543+
Represents the C 8-bit :c:expr:`signed int` datatype. It is an alias for
25282544
:class:`c_byte`.
25292545

25302546

@@ -2599,7 +2615,7 @@ These are the fundamental ctypes data types:
25992615

26002616
.. class:: c_uint8
26012617

2602-
Represents the C 8-bit :c:expr:`unsigned int` datatype. Usually an alias for
2618+
Represents the C 8-bit :c:expr:`unsigned int` datatype. It is an alias for
26032619
:class:`c_ubyte`.
26042620

26052621

Doc/library/fnmatch.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ a :class:`!str` filename, and vice-versa.
5353

5454
Finally, note that :func:`functools.lru_cache` with a *maxsize* of 32768
5555
is used to cache the (typed) compiled regex patterns in the following
56-
functions: :func:`fnmatch`, :func:`fnmatchcase`, :func:`.filter`.
56+
functions: :func:`fnmatch`, :func:`fnmatchcase`, :func:`.filter`, :func:`.filterfalse`.
5757

5858

5959
.. function:: fnmatch(name, pat)

Doc/library/fractions.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ another rational number, or from a string.
2525

2626
The first version requires that *numerator* and *denominator* are instances
2727
of :class:`numbers.Rational` and returns a new :class:`Fraction` instance
28-
with value ``numerator/denominator``. If *denominator* is ``0``, it
29-
raises a :exc:`ZeroDivisionError`.
28+
with value equal to ``numerator/denominator`` where the denominator is positive.
29+
If *denominator* is ``0``, it raises a :exc:`ZeroDivisionError`.
3030

3131
The second version requires that *number* is an instance of
3232
:class:`numbers.Rational` or has the :meth:`!as_integer_ratio` method

Doc/library/ipaddress.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,16 @@ write code that handles both IP versions correctly. Address objects are
240240

241241
.. attribute:: is_reserved
242242

243-
``True`` if the address is otherwise IETF reserved.
243+
``True`` if the address is noted as reserved by the IETF.
244+
For IPv4, this is only ``240.0.0.0/4``, the ``Reserved`` address block.
245+
For IPv6, this is all addresses `allocated <iana-ipv6-address-space_>`__ as
246+
``Reserved by IETF`` for future use.
247+
248+
.. note:: For IPv4, ``is_reserved`` is not related to the address block value of the
249+
``Reserved-by-Protocol`` column in iana-ipv4-special-registry_.
250+
251+
.. caution:: For IPv6, ``fec0::/10`` a former Site-Local scoped address prefix is
252+
currently excluded from that list (see :attr:`~IPv6Address.is_site_local` & :rfc:`3879`).
244253

245254
.. attribute:: is_loopback
246255

@@ -261,6 +270,7 @@ write code that handles both IP versions correctly. Address objects are
261270

262271
.. _iana-ipv4-special-registry: https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml
263272
.. _iana-ipv6-special-registry: https://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml
273+
.. _iana-ipv6-address-space: https://www.iana.org/assignments/ipv6-address-space/ipv6-address-space.xhtml
264274

265275
.. method:: IPv4Address.__format__(fmt)
266276

Doc/library/itertools.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Iterator Arguments Results
4747
Iterator Arguments Results Example
4848
============================ ============================ ================================================= =============================================================
4949
:func:`accumulate` p [,func] p0, p0+p1, p0+p1+p2, ... ``accumulate([1,2,3,4,5]) → 1 3 6 10 15``
50-
:func:`batched` p, n (p0, p1, ..., p_n-1), ... ``batched('ABCDEFG', n=3) → ABC DEF G``
50+
:func:`batched` p, n (p0, p1, ..., p_n-1), ... ``batched('ABCDEFG', n=2) → AB CD EF G``
5151
:func:`chain` p, q, ... p0, p1, ... plast, q0, q1, ... ``chain('ABC', 'DEF') → A B C D E F``
5252
:func:`chain.from_iterable` iterable p0, p1, ... plast, q0, q1, ... ``chain.from_iterable(['ABC', 'DEF']) → A B C D E F``
5353
:func:`compress` data, selectors (d[0] if s[0]), (d[1] if s[1]), ... ``compress('ABCDEF', [1,0,1,0,1,1]) → A C E F``
@@ -181,7 +181,7 @@ loops that truncate the stream.
181181
Roughly equivalent to::
182182

183183
def batched(iterable, n, *, strict=False):
184-
# batched('ABCDEFG', 3) → ABC DEF G
184+
# batched('ABCDEFG', 2) → AB CD EF G
185185
if n < 1:
186186
raise ValueError('n must be at least one')
187187
iterator = iter(iterable)

Doc/library/multiprocessing.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -936,8 +936,13 @@ For an example of the usage of queues for interprocess communication see
936936

937937
.. method:: close()
938938

939-
Indicate that no more data will be put on this queue by the current
940-
process. The background thread will quit once it has flushed all buffered
939+
Close the queue: release internal resources.
940+
941+
A queue must not be used anymore after it is closed. For example,
942+
:meth:`~Queue.get`, :meth:`~Queue.put` and :meth:`~Queue.empty`
943+
methods must no longer be called.
944+
945+
The background thread will quit once it has flushed all buffered
941946
data to the pipe. This is called automatically when the queue is garbage
942947
collected.
943948

Doc/library/pathlib.rst

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -542,20 +542,6 @@ Pure paths provide the following methods and properties:
542542
Passing additional arguments is deprecated; if supplied, they are joined
543543
with *other*.
544544

545-
.. method:: PurePath.is_reserved()
546-
547-
With :class:`PureWindowsPath`, return ``True`` if the path is considered
548-
reserved under Windows, ``False`` otherwise. With :class:`PurePosixPath`,
549-
``False`` is always returned.
550-
551-
.. versionchanged:: 3.13
552-
Windows path names that contain a colon, or end with a dot or a space,
553-
are considered reserved. UNC paths may be reserved.
554-
555-
.. deprecated-removed:: 3.13 3.15
556-
This method is deprecated; use :func:`os.path.isreserved` to detect
557-
reserved paths on Windows.
558-
559545
.. method:: PurePath.joinpath(*pathsegments)
560546

561547
Calling this method is equivalent to combining the path with each of

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy