Skip to content

Commit 9d162ef

Browse files
committed
Merge branch 'main' into bpo_45113_3
* main: (263 commits) bpo-45521: Fix a bug in the obmalloc radix tree code. (pythonGH-29051) bpo-45522: Allow to disable freelists on build time (pythonGH-29056) bpo-34451: Document prompt and output toggle feature in html tutorial (pythonGH-27105) bpo-44019: Add operator.call() to __all__ for the operator module (pythonGH-29110) bpo-45315: PyType_FromSpec: Copy spec->name and have the type own the memory for its name (pythonGH-29103) bpo-44220: Export PyStructSequence_UnnamedField in the limited API (pythonGH-26331) bpo-44174: [Enum] add reference to name mangling (pythonGH-29116) bpo-45548: add some missing entries to `Modules/Setup` (pythonGH-29115) bpo-35673: Add a public alias for namespace package __loader__ attribute (python#29049) bpo-45192: Fix a bug that infers the type of an os.PathLike[bytes] object as str (pythonGH-28323) bpo-45527: Don't count cache hits, just misses. (pythonGH-29092) bpo-45320: Remove long-deprecated inspect methods (pythonGH-28618) bpo-41374: Remove obsolete exclusion of netinet/tcp.h on Cygwin (pythonGH-21649) bpo-45532: Replace 'default' with 'main' as default in sys.version (pythonGH-29100) bpo-45464: [doc] Explain that subclassing multiple exceptions is fragile (pythonGH-29094) Cleanup a couple of comments left on PR 28775 post-merge. (pythonGH-29079) bpo-45536: Check OpenSSL APIs in configure (pythonGH-29088) Add PEPs 593 & 647 to list of PEPs at top of typing docs (pythonGH-29097) Add a comment about how to fix bogus test_host_resolution_bad_address failures (python#29085) bpo-44525: Specialize simple Python calls. (pythonGH-29033) ...
2 parents 735ffb0 + 311910b commit 9d162ef

1,124 files changed

Lines changed: 16469 additions & 7509 deletions

File tree

Some content is hidden

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

.github/workflows/build.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ jobs:
8585
- name: Check limited ABI symbols
8686
run: make check-limited-abi
8787
- name: Check Autoconf version 2.69
88-
run: grep "Generated by GNU Autoconf 2.69" configure
88+
run: |
89+
grep "Generated by GNU Autoconf 2.69" configure
90+
grep "PKG_PROG_PKG_CONFIG" aclocal.m4
8991
9092
build_win32:
9193
name: 'Windows (x86)'
@@ -126,8 +128,12 @@ jobs:
126128
PYTHONSTRICTEXTENSIONBUILD: 1
127129
steps:
128130
- uses: actions/checkout@v2
131+
- name: Prepare homebrew environment variables
132+
run: |
133+
echo "LDFLAGS=-L$(brew --prefix tcl-tk)/lib" >> $GITHUB_ENV
134+
echo "PKG_CONFIG_PATH=$(brew --prefix openssl@1.1)/lib/pkgconfig:$(brew --prefix tcl-tk)/lib/pkgconfig" >> $GITHUB_ENV
129135
- name: Configure CPython
130-
run: ./configure --with-pydebug --with-openssl=/usr/local/opt/openssl --prefix=/opt/python-dev
136+
run: ./configure --with-pydebug --prefix=/opt/python-dev
131137
- name: Build CPython
132138
run: make -j4
133139
- name: Display build info

Doc/c-api/call.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ Object Calling API
185185
Various functions are available for calling a Python object.
186186
Each converts its arguments to a convention supported by the called object –
187187
either *tp_call* or vectorcall.
188-
In order to do as litle conversion as possible, pick one that best fits
188+
In order to do as little conversion as possible, pick one that best fits
189189
the format of data you have available.
190190
191191
The following table summarizes the available functions;

Doc/c-api/init.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,6 +1173,26 @@ All of the following functions must be called after :c:func:`Py_Initialize`.
11731173
.. versionadded:: 3.9
11741174
11751175
1176+
.. c:function:: void PyThreadState_EnterTracing(PyThreadState *tstate)
1177+
1178+
Suspend tracing and profiling in the Python thread state *tstate*.
1179+
1180+
Resume them using the :c:func:`PyThreadState_LeaveTracing` function.
1181+
1182+
.. versionadded:: 3.11
1183+
1184+
1185+
.. c:function:: void PyThreadState_LeaveTracing(PyThreadState *tstate)
1186+
1187+
Resume tracing and profiling in the Python thread state *tstate* suspended
1188+
by the :c:func:`PyThreadState_EnterTracing` function.
1189+
1190+
See also :c:func:`PyEval_SetTrace` and :c:func:`PyEval_SetProfile`
1191+
functions.
1192+
1193+
.. versionadded:: 3.11
1194+
1195+
11761196
.. c:function:: PyInterpreterState* PyInterpreterState_Get(void)
11771197
11781198
Get the current interpreter.
@@ -1623,6 +1643,8 @@ Python-level trace functions in previous versions.
16231643
profile function is called for all monitored events except :const:`PyTrace_LINE`
16241644
:const:`PyTrace_OPCODE` and :const:`PyTrace_EXCEPTION`.
16251645
1646+
See also the :func:`sys.setprofile` function.
1647+
16261648
The caller must hold the :term:`GIL`.
16271649
16281650
@@ -1635,6 +1657,8 @@ Python-level trace functions in previous versions.
16351657
will not receive :const:`PyTrace_C_CALL`, :const:`PyTrace_C_EXCEPTION` or
16361658
:const:`PyTrace_C_RETURN` as a value for the *what* parameter.
16371659
1660+
See also the :func:`sys.settrace` function.
1661+
16381662
The caller must hold the :term:`GIL`.
16391663
16401664

Doc/c-api/init_config.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ There are two kinds of configuration:
2222
* The :ref:`Isolated Configuration <init-isolated-conf>` can be used to embed
2323
Python into an application. It isolates Python from the system. For example,
2424
environments variables are ignored, the LC_CTYPE locale is left unchanged and
25-
no signal handler is registred.
25+
no signal handler is registered.
2626

2727
The :c:func:`Py_RunMain` function can be used to write a customized Python
2828
program.
@@ -706,7 +706,7 @@ PyConfig
706706
* Otherwise, use the :term:`locale encoding`:
707707
``nl_langinfo(CODESET)`` result.
708708
709-
At Python statup, the encoding name is normalized to the Python codec
709+
At Python startup, the encoding name is normalized to the Python codec
710710
name. For example, ``"ANSI_X3.4-1968"`` is replaced with ``"ascii"``.
711711
712712
See also the :c:member:`~PyConfig.filesystem_errors` member.

Doc/data/stable_abi.dat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,7 @@ function,PyStructSequence_GetItem,3.2,
570570
function,PyStructSequence_New,3.2,
571571
function,PyStructSequence_NewType,3.2,
572572
function,PyStructSequence_SetItem,3.2,
573+
var,PyStructSequence_UnnamedField,3.11,
573574
var,PySuper_Type,3.2,
574575
function,PySys_AddWarnOption,3.2,
575576
function,PySys_AddWarnOptionUnicode,3.2,

Doc/distributing/index.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ installing other Python projects, refer to the
3131
Key terms
3232
=========
3333

34-
* the `Python Packaging Index <https://pypi.org>`__ is a public
34+
* the `Python Package Index <https://pypi.org>`__ is a public
3535
repository of open source licensed packages made available for use by
3636
other Python users
3737
* the `Python Packaging Authority
@@ -127,14 +127,14 @@ involved in creating and publishing a project:
127127

128128
* `Project structure`_
129129
* `Building and packaging the project`_
130-
* `Uploading the project to the Python Packaging Index`_
130+
* `Uploading the project to the Python Package Index`_
131131
* `The .pypirc file`_
132132

133133
.. _Project structure: \
134134
https://packaging.python.org/tutorials/packaging-projects/#packaging-python-projects
135135
.. _Building and packaging the project: \
136136
https://packaging.python.org/tutorials/packaging-projects/#creating-the-package-files
137-
.. _Uploading the project to the Python Packaging Index: \
137+
.. _Uploading the project to the Python Package Index: \
138138
https://packaging.python.org/tutorials/packaging-projects/#uploading-the-distribution-archives
139139
.. _The .pypirc file: \
140140
https://packaging.python.org/specifications/pypirc/
@@ -150,7 +150,7 @@ These are quick answers or links for some common tasks.
150150

151151
This isn't an easy topic, but here are a few tips:
152152

153-
* check the Python Packaging Index to see if the name is already in use
153+
* check the Python Package Index to see if the name is already in use
154154
* check popular hosting sites like GitHub, Bitbucket, etc to see if there
155155
is already a project with that name
156156
* check what comes up in a web search for the name you're considering

Doc/faq/design.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ Why don't generators support the with statement?
714714
For technical reasons, a generator used directly as a context manager
715715
would not work correctly. When, as is most common, a generator is used as
716716
an iterator run to completion, no closing is needed. When it is, wrap
717-
it as "contextlib.closing(generator)" in the 'with' statment.
717+
it as "contextlib.closing(generator)" in the 'with' statement.
718718

719719

720720
Why are colons required for the if/while/def/class statements?

Doc/faq/extending.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,6 @@ complete example using the GNU readline library (you may want to ignore
290290

291291
#define PY_SSIZE_T_CLEAN
292292
#include <Python.h>
293-
#include <object.h>
294-
#include <compile.h>
295-
#include <eval.h>
296293

297294
int main (int argc, char* argv[])
298295
{

Doc/faq/programming.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,27 @@ ago? ``-190 % 12 == 2`` is useful; ``-190 % 12 == -10`` is a bug waiting to
836836
bite.
837837

838838

839+
How do I get int literal attribute instead of SyntaxError?
840+
----------------------------------------------------------
841+
842+
Trying to lookup an ``int`` literal attribute in the normal manner gives
843+
a syntax error because the period is seen as a decimal point::
844+
845+
>>> 1.__class__
846+
File "<stdin>", line 1
847+
1.__class__
848+
^
849+
SyntaxError: invalid decimal literal
850+
851+
The solution is to separate the literal from the period
852+
with either a space or parentheses.
853+
854+
>>> 1 .__class__
855+
<class 'int'>
856+
>>> (1).__class__
857+
<class 'int'>
858+
859+
839860
How do I convert a string to a number?
840861
--------------------------------------
841862

Doc/faq/windows.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ Embedding the Python interpreter in a Windows app can be summarized as follows:
212212

213213
.. code-block:: c
214214
215-
#include "python.h"
215+
#include <Python.h>
216216
...
217217
Py_Initialize(); // Initialize Python.
218218
initmyAppc(); // Initialize (import) the helper class.

0 commit comments

Comments
 (0)