Skip to content

Commit f44d663

Browse files
authored
Merge branch 'main' into configparser_perf
2 parents 8610c71 + c26bed1 commit f44d663

38 files changed

+1317
-373
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,7 @@ jobs:
658658
build_asan,
659659
build_tsan,
660660
test_hypothesis,
661+
cross-build-linux,
661662
'
662663
|| ''
663664
}}

Doc/c-api/unicode.rst

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -256,13 +256,8 @@ the Python configuration.
256256
257257
.. c:function:: int Py_UNICODE_ISPRINTABLE(Py_UCS4 ch)
258258
259-
Return ``1`` or ``0`` depending on whether *ch* is a printable character.
260-
Nonprintable characters are those characters defined in the Unicode character
261-
database as "Other" or "Separator", excepting the ASCII space (0x20) which is
262-
considered printable. (Note that printable characters in this context are
263-
those which should not be escaped when :func:`repr` is invoked on a string.
264-
It has no bearing on the handling of strings written to :data:`sys.stdout` or
265-
:data:`sys.stderr`.)
259+
Return ``1`` or ``0`` depending on whether *ch* is a printable character,
260+
in the sense of :meth:`str.isprintable`.
266261
267262
268263
These APIs can be used for fast direct character conversions:

Doc/glossary.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -939,11 +939,16 @@ Glossary
939939
modules, respectively.
940940

941941
namespace package
942-
A :pep:`420` :term:`package` which serves only as a container for
943-
subpackages. Namespace packages may have no physical representation,
942+
A :term:`package` which serves only as a container for subpackages.
943+
Namespace packages may have no physical representation,
944944
and specifically are not like a :term:`regular package` because they
945945
have no ``__init__.py`` file.
946946

947+
Namespace packages allow several individually installable packages to have a common parent package.
948+
Otherwise, it is recommended to use a :term:`regular package`.
949+
950+
For more information, see :pep:`420` and :ref:`reference-namespace-package`.
951+
947952
See also :term:`module`.
948953

949954
nested scope

Doc/library/stdtypes.rst

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2012,13 +2012,19 @@ expression support in the :mod:`re` module).
20122012

20132013
.. method:: str.isprintable()
20142014

2015-
Return ``True`` if all characters in the string are printable or the string is
2016-
empty, ``False`` otherwise. Nonprintable characters are those characters defined
2017-
in the Unicode character database as "Other" or "Separator", excepting the
2018-
ASCII space (0x20) which is considered printable. (Note that printable
2019-
characters in this context are those which should not be escaped when
2020-
:func:`repr` is invoked on a string. It has no bearing on the handling of
2021-
strings written to :data:`sys.stdout` or :data:`sys.stderr`.)
2015+
Return true if all characters in the string are printable, false if it
2016+
contains at least one non-printable character.
2017+
2018+
Here "printable" means the character is suitable for :func:`repr` to use in
2019+
its output; "non-printable" means that :func:`repr` on built-in types will
2020+
hex-escape the character. It has no bearing on the handling of strings
2021+
written to :data:`sys.stdout` or :data:`sys.stderr`.
2022+
2023+
The printable characters are those which in the Unicode character database
2024+
(see :mod:`unicodedata`) have a general category in group Letter, Mark,
2025+
Number, Punctuation, or Symbol (L, M, N, P, or S); plus the ASCII space 0x20.
2026+
Nonprintable characters are those in group Separator or Other (Z or C),
2027+
except the ASCII space.
20222028

20232029

20242030
.. method:: str.isspace()

Doc/library/unittest.mock.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2008,7 +2008,7 @@ Imagine we have a project that we want to test with the following structure::
20082008

20092009
Now we want to test ``some_function`` but we want to mock out ``SomeClass`` using
20102010
:func:`patch`. The problem is that when we import module b, which we will have to
2011-
do then it imports ``SomeClass`` from module a. If we use :func:`patch` to mock out
2011+
do when it imports ``SomeClass`` from module a. If we use :func:`patch` to mock out
20122012
``a.SomeClass`` then it will have no effect on our test; module b already has a
20132013
reference to the *real* ``SomeClass`` and it looks like our patching had no
20142014
effect.

Doc/reference/import.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ Importing ``parent.one`` will implicitly execute ``parent/__init__.py`` and
123123
``parent/three/__init__.py`` respectively.
124124

125125

126+
.. _reference-namespace-package:
127+
126128
Namespace packages
127129
------------------
128130

Doc/whatsnew/3.14.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,9 @@ configuration mechanisms).
224224
A new type of interpreter
225225
-------------------------
226226

227-
A new type of interpreter based on tail calls has been added to CPython.
227+
A new type of interpreter has been added to CPython.
228+
It uses tail calls between small C functions that implement individual
229+
Python opcodes, rather than one large C case statement.
228230
For certain newer compilers, this interpreter provides
229231
significantly better performance. Preliminary numbers on our machines suggest
230232
anywhere from -3% to 30% faster Python code, and a geometric mean of 9-15%

Grammar/python.gram

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ import_name[stmt_ty]: 'import' a=dotted_as_names { _PyAST_Import(a, EXTRA) }
207207
# note below: the ('.' | '...') is necessary because '...' is tokenized as ELLIPSIS
208208
import_from[stmt_ty]:
209209
| 'from' a=('.' | '...')* b=dotted_name 'import' c=import_from_targets {
210-
_PyAST_ImportFrom(b->v.Name.id, c, _PyPegen_seq_count_dots(a), EXTRA) }
210+
_PyPegen_checked_future_import(p, b->v.Name.id, c, _PyPegen_seq_count_dots(a), EXTRA) }
211211
| 'from' a=('.' | '...')+ 'import' b=import_from_targets {
212212
_PyAST_ImportFrom(NULL, b, _PyPegen_seq_count_dots(a), EXTRA) }
213213
import_from_targets[asdl_alias_seq*]:

Include/cpython/bytearrayobject.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ static inline char* PyByteArray_AS_STRING(PyObject *op)
2929

3030
static inline Py_ssize_t PyByteArray_GET_SIZE(PyObject *op) {
3131
PyByteArrayObject *self = _PyByteArray_CAST(op);
32+
#ifdef Py_GIL_DISABLED
33+
return _Py_atomic_load_ssize_relaxed(&(_PyVarObject_CAST(self)->ob_size));
34+
#else
3235
return Py_SIZE(self);
36+
#endif
3337
}
3438
#define PyByteArray_GET_SIZE(self) PyByteArray_GET_SIZE(_PyObject_CAST(self))

Lib/asyncio/base_events.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,8 +671,8 @@ def _run_forever_cleanup(self):
671671

672672
def run_forever(self):
673673
"""Run until stop() is called."""
674+
self._run_forever_setup()
674675
try:
675-
self._run_forever_setup()
676676
while True:
677677
self._run_once()
678678
if self._stopping:

0 commit comments

Comments
 (0)