Skip to content

Commit 5fe6fc4

Browse files
authored
Merge branch 'main' into doc_argparse_empty_rows
2 parents 1cfa51b + d19bb44 commit 5fe6fc4

File tree

10 files changed

+34
-11
lines changed

10 files changed

+34
-11
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/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/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/using/configure.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,9 @@ Debug options
802802
.. option:: --with-address-sanitizer
803803

804804
Enable AddressSanitizer memory error detector, ``asan`` (default is no).
805+
To improve ASan detection capabilities you may also want to combine this
806+
with :option:`--without-pymalloc` to disable the specialized small-object
807+
allocator whose allocations are not tracked by ASan.
805808

806809
.. versionadded:: 3.6
807810

Lib/test/test_ast/test_ast.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3545,7 +3545,7 @@ def test_show_empty_flag(self):
35453545
self.check_output(source, expect, '--show-empty')
35463546

35473547

3548-
class ASTOptimiziationTests(unittest.TestCase):
3548+
class ASTOptimizationTests(unittest.TestCase):
35493549
def wrap_expr(self, expr):
35503550
return ast.Module(body=[ast.Expr(value=expr)])
35513551

Modules/_ctypes/stgdict.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ error:;
484484

485485
/*
486486
Replace array elements at stginfo->ffi_type_pointer.elements.
487-
Return -1 if error occured.
487+
Return -1 if error occurred.
488488
*/
489489
int
490490
_replace_array_elements(ctypes_state *st, PyObject *layout_fields,

Modules/_interpretersmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ _run_in_interpreter(PyThreadState *tstate, PyInterpreterState *interp,
666666

667667
// Prep and switch interpreters.
668668
if (_PyXI_Enter(session, interp, shareables, &result) < 0) {
669-
// If an error occured at this step, it means that interp
669+
// If an error occurred at this step, it means that interp
670670
// was not prepared and switched.
671671
_PyXI_FreeSession(session);
672672
_PyXI_FreeFailure(failure);

Tools/peg_generator/pegen/parser_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def visit_NamedItem(self, item: NamedItem) -> None:
5656

5757

5858
class KeywordCollectorVisitor(GrammarVisitor):
59-
"""Visitor that collects all the keywods and soft keywords in the Grammar"""
59+
"""Visitor that collects all the keywords and soft keywords in the Grammar"""
6060

6161
def __init__(self, gen: "ParserGenerator", keywords: Dict[str, int], soft_keywords: Set[str]):
6262
self.generator = gen

0 commit comments

Comments
 (0)