Skip to content

Commit b3448fd

Browse files
authored
Merge branch 'main' into setobject-note
2 parents 4333933 + 80abd62 commit b3448fd

26 files changed

+948
-86
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ jobs:
111111
run: make smelly
112112
- name: Check limited ABI symbols
113113
run: make check-limited-abi
114+
- name: Check for unsupported C global variables
115+
if: github.event_name == 'pull_request' # $GITHUB_EVENT_NAME
116+
run: make check-c-globals
114117

115118
build_win32:
116119
name: 'Windows (x86)'

Doc/c-api/gcsupport.rst

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,3 +228,36 @@ garbage collection runs.
228228
Returns the current state, 0 for disabled and 1 for enabled.
229229
230230
.. versionadded:: 3.10
231+
232+
233+
Querying Garbage Collector State
234+
--------------------------------
235+
236+
The C-API provides the following interface for querying information about
237+
the garbage collector.
238+
239+
.. c:function:: void PyUnstable_GC_VisitObjects(gcvisitobjects_t callback, void *arg)
240+
241+
Run supplied *callback* on all live GC-capable objects. *arg* is passed through to
242+
all invocations of *callback*.
243+
244+
.. warning::
245+
If new objects are (de)allocated by the callback it is undefined if they
246+
will be visited.
247+
248+
Garbage collection is disabled during operation. Explicitly running a collection
249+
in the callback may lead to undefined behaviour e.g. visiting the same objects
250+
multiple times or not at all.
251+
252+
.. versionadded:: 3.12
253+
254+
.. c:type:: int (*gcvisitobjects_t)(PyObject *object, void *arg)
255+
256+
Type of the visitor function to be passed to :c:func:`PyUnstable_GC_VisitObjects`.
257+
*arg* is the same as the *arg* passed to ``PyUnstable_GC_VisitObjects``.
258+
Return ``0`` to continue iteration, return ``1`` to stop iteration. Other return
259+
values are reserved for now so behavior on returning anything else is undefined.
260+
261+
.. versionadded:: 3.12
262+
263+

Doc/library/__main__.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ one mentioned below are preferred.
259259

260260
See :mod:`venv` for an example of a package with a minimal ``__main__.py``
261261
in the standard library. It doesn't contain a ``if __name__ == '__main__'``
262-
block. You can invoke it with ``python3 -m venv [directory]``.
262+
block. You can invoke it with ``python -m venv [directory]``.
263263

264264
See :mod:`runpy` for more details on the :option:`-m` flag to the
265265
interpreter executable.

Doc/library/asyncio-task.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -814,9 +814,6 @@ Waiting Primitives
814814
Raises :exc:`TimeoutError` if the timeout occurs before
815815
all Futures are done.
816816

817-
.. versionchanged:: 3.10
818-
Removed the *loop* parameter.
819-
820817
Example::
821818

822819
for coro in as_completed(aws):

Doc/library/importlib.metadata.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ something into it:
7373

7474
.. code-block:: shell-session
7575
76-
$ python3 -m venv example
76+
$ python -m venv example
7777
$ source example/bin/activate
7878
(example) $ python -m pip install wheel
7979

Doc/library/pdb.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ of the debugger is::
5858
:file:`pdb.py` can also be invoked as a script to debug other scripts. For
5959
example::
6060

61-
python3 -m pdb myscript.py
61+
python -m pdb myscript.py
6262

6363
When invoked as a script, pdb will automatically enter post-mortem debugging if
6464
the program being debugged exits abnormally. After post-mortem debugging (or
@@ -72,7 +72,7 @@ useful than quitting the debugger upon program's exit.
7272

7373
.. versionadded:: 3.7
7474
:file:`pdb.py` now accepts a ``-m`` option that execute modules similar to the way
75-
``python3 -m`` does. As with a script, the debugger will pause execution just
75+
``python -m`` does. As with a script, the debugger will pause execution just
7676
before the first line of the module.
7777

7878

Doc/reference/datamodel.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1944,8 +1944,10 @@ Notes on using *__slots__*
19441944
descriptor directly from the base class). This renders the meaning of the
19451945
program undefined. In the future, a check may be added to prevent this.
19461946

1947-
* Nonempty *__slots__* does not work for classes derived from "variable-length"
1948-
built-in types such as :class:`int`, :class:`bytes` and :class:`tuple`.
1947+
* :exc:`TypeError` will be raised if nonempty *__slots__* are defined for a
1948+
class derived from a
1949+
:c:member:`"variable-length" built-in type <PyTypeObject.tp_itemsize>` such as
1950+
:class:`int`, :class:`bytes`, and :class:`tuple`.
19491951

19501952
* Any non-string :term:`iterable` may be assigned to *__slots__*.
19511953

Doc/tutorial/venv.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ whichever version you want.
4444
To create a virtual environment, decide upon a directory where you want to
4545
place it, and run the :mod:`venv` module as a script with the directory path::
4646

47-
python3 -m venv tutorial-env
47+
python -m venv tutorial-env
4848

4949
This will create the ``tutorial-env`` directory if it doesn't exist,
5050
and also create directories inside it containing a copy of the Python

Doc/using/venv-create.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Creation of :ref:`virtual environments <venv-def>` is done by executing the
22
command ``venv``::
33

4-
python3 -m venv /path/to/new/virtual/environment
4+
python -m venv /path/to/new/virtual/environment
55

66
Running this command creates the target directory (creating any parent
77
directories that don't exist already) and places a ``pyvenv.cfg`` file in it

0 commit comments

Comments
 (0)