Skip to content

Commit cf3699b

Browse files
authored
Merge branch 'main' into enum-fix_auto
2 parents 0cf34e2 + 586b07e commit cf3699b

File tree

386 files changed

+13851
-29092
lines changed

Some content is hidden

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

386 files changed

+13851
-29092
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ Parser/parser.c generated
8282
Parser/token.c generated
8383
Programs/test_frozenmain.h generated
8484
Python/Python-ast.c generated
85+
Python/generated_cases.c.h generated
8586
Python/opcode_targets.h generated
8687
Python/stdlib_module_names.h generated
8788
Tools/peg_generator/pegen/grammar_parser.py generated

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ gmon.out
4141
.DS_Store
4242

4343
*.exe
44-
!Lib/distutils/command/*.exe
4544

4645
# Ignore core dumps... but not Tools/msi/core/ or the like.
4746
core
@@ -58,7 +57,6 @@ Doc/.venv/
5857
Doc/env/
5958
Doc/.env/
6059
Include/pydtrace_probes.h
61-
Lib/distutils/command/*.pdb
6260
Lib/lib2to3/*.pickle
6361
Lib/site-packages/*
6462
!Lib/site-packages/README.txt
@@ -116,6 +114,7 @@ PCbuild/win32/
116114
Tools/unicode/data/
117115
/autom4te.cache
118116
/build/
117+
/builddir/
119118
/config.cache
120119
/config.log
121120
/config.status

Doc/c-api/init_config.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,8 +1571,6 @@ Private provisional API:
15711571
15721572
* :c:member:`PyConfig._init_main`: if set to ``0``,
15731573
:c:func:`Py_InitializeFromConfig` stops at the "Core" initialization phase.
1574-
* :c:member:`PyConfig._isolated_interpreter`: if non-zero,
1575-
disallow threads, subprocesses and fork.
15761574
15771575
.. c:function:: PyStatus _Py_InitializeMain(void)
15781576

Doc/c-api/memory.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ for the I/O buffer escapes completely the Python memory manager.
9595
Allocator Domains
9696
=================
9797

98+
.. _allocator-domains:
99+
98100
All allocating functions belong to one of three different "domains" (see also
99101
:c:type:`PyMemAllocatorDomain`). These domains represent different allocation
100102
strategies and are optimized for different purposes. The specific details on
@@ -479,6 +481,25 @@ Customize Memory Allocators
479481
See also :c:member:`PyPreConfig.allocator` and :ref:`Preinitialize Python
480482
with PyPreConfig <c-preinit>`.
481483
484+
.. warning::
485+
486+
:c:func:`PyMem_SetAllocator` does have the following contract:
487+
488+
* It can be called after :c:func:`Py_PreInitialize` and before
489+
:c:func:`Py_InitializeFromConfig` to install a custom memory
490+
allocator. There are no restrictions over the installed allocator
491+
other than the ones imposed by the domain (for instance, the Raw
492+
Domain allows the allocator to be called without the GIL held). See
493+
:ref:`the section on allocator domains <allocator-domains>` for more
494+
information.
495+
496+
* If called after Python has finish initializing (after
497+
:c:func:`Py_InitializeFromConfig` has been called) the allocator
498+
**must** wrap the existing allocator. Substituting the current
499+
allocator for some other arbitrary one is **not supported**.
500+
501+
502+
482503
.. c:function:: void PyMem_SetupDebugHooks(void)
483504
484505
Setup :ref:`debug hooks in the Python memory allocators <pymem-debug-hooks>`

Doc/c-api/structures.rst

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -485,23 +485,25 @@ Accessing attributes of extension types
485485
Structure to define property-like access for a type. See also description of
486486
the :c:member:`PyTypeObject.tp_getset` slot.
487487
488-
+-------------+------------------+-----------------------------------+
489-
| Field | C Type | Meaning |
490-
+=============+==================+===================================+
491-
| name | const char \* | attribute name |
492-
+-------------+------------------+-----------------------------------+
493-
| get | getter | C function to get the attribute |
494-
+-------------+------------------+-----------------------------------+
495-
| set | setter | optional C function to set or |
496-
| | | delete the attribute, if omitted |
497-
| | | the attribute is readonly |
498-
+-------------+------------------+-----------------------------------+
499-
| doc | const char \* | optional docstring |
500-
+-------------+------------------+-----------------------------------+
501-
| closure | void \* | optional function pointer, |
502-
| | | providing additional data for |
503-
| | | getter and setter |
504-
+-------------+------------------+-----------------------------------+
488+
.. c:member:: const char* PyGetSetDef.name
489+
490+
attribute name
491+
492+
.. c:member:: getter PyGetSetDef.get
493+
494+
C funtion to get the attribute.
495+
496+
.. c:member:: setter PyGetSetDef.set
497+
498+
Optional C function to set or delete the attribute, if omitted the attribute is readonly.
499+
500+
.. c:member:: const char* PyGetSetDef.doc
501+
502+
optional docstring
503+
504+
.. c:member:: void* PyGetSetDef.closure
505+
506+
Optional function pointer, providing additional data for getter and setter.
505507
506508
The ``get`` function takes one :c:expr:`PyObject*` parameter (the
507509
instance) and a function pointer (the associated ``closure``)::

Doc/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@
197197
coverage_ignore_modules = [
198198
r'[T|t][k|K]',
199199
r'Tix',
200-
r'distutils.*',
201200
]
202201

203202
coverage_ignore_functions = [

Doc/data/stable_abi.dat

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

Doc/extending/embedding.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -298,16 +298,16 @@ be directly useful to you:
298298

299299
.. code-block:: shell-session
300300
301-
$ /opt/bin/python3.4-config --cflags
302-
-I/opt/include/python3.4m -I/opt/include/python3.4m -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes
301+
$ /opt/bin/python3.11-config --cflags
302+
-I/opt/include/python3.11 -I/opt/include/python3.11 -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall
303303
304-
* ``pythonX.Y-config --ldflags`` will give you the recommended flags when
305-
linking:
304+
* ``pythonX.Y-config --ldflags --embed`` will give you the recommended flags
305+
when linking:
306306

307307
.. code-block:: shell-session
308308
309-
$ /opt/bin/python3.4-config --ldflags
310-
-L/opt/lib/python3.4/config-3.4m -lpthread -ldl -lutil -lm -lpython3.4m -Xlinker -export-dynamic
309+
$ /opt/bin/python3.11-config --ldflags --embed
310+
-L/opt/lib/python3.11/config-3.11-x86_64-linux-gnu -L/opt/lib -lpython3.11 -lpthread -ldl -lutil -lm
311311
312312
.. note::
313313
To avoid confusion between several Python installations (and especially

0 commit comments

Comments
 (0)