Skip to content

Commit b19cbe6

Browse files
committed
Deploying to gh-pages from @ c6d74e2 🚀
1 parent 5c87206 commit b19cbe6

File tree

634 files changed

+13043
-11200
lines changed

Some content is hidden

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

634 files changed

+13043
-11200
lines changed

.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: 72c96231f81f6934f059b068a0617190
3+
config: 027112e6b110a6ec310dc8c74832cccb
44
tags: 645f666f9bcd5a90fca523b33c5a78b7
-42.9 KB
Loading
-25 KB
Loading

_images/win_installer.png

-4.56 KB
Loading

_sources/c-api/init.rst.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1547,6 +1547,9 @@ All of the following functions must be called after :c:func:`Py_Initialize`.
15471547
This is not a replacement for :c:func:`PyModule_GetState()`, which
15481548
extensions should use to store interpreter-specific state information.
15491549
1550+
The returned dictionary is borrowed from the interpreter and is valid until
1551+
interpreter shutdown.
1552+
15501553
.. versionadded:: 3.8
15511554
15521555
@@ -1999,6 +2002,10 @@ pointer and a void pointer argument.
19992002
called from the main interpreter. Each subinterpreter now has its own
20002003
list of scheduled calls.
20012004
2005+
.. versionchanged:: 3.12
2006+
This function now always schedules *func* to be run in the main
2007+
interpreter.
2008+
20022009
.. _profiling:
20032010
20042011
Profiling and Tracing

_sources/c-api/unicode.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ APIs:
731731
Return ``0`` on success, ``-1`` on error with an exception set.
732732
733733
This function checks that *unicode* is a Unicode object, that the index is
734-
not out of bounds, and that the object's reference count is one).
734+
not out of bounds, and that the object's reference count is one.
735735
See :c:func:`PyUnicode_WRITE` for a version that skips these checks,
736736
making them your responsibility.
737737

_sources/c-api/veryhigh.rst.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,8 @@ the same library that the Python runtime is using.
183183
objects *globals* and *locals* with the compiler flags specified by
184184
*flags*. *globals* must be a dictionary; *locals* can be any object
185185
that implements the mapping protocol. The parameter *start* specifies
186-
the start token that should be used to parse the source code.
186+
the start symbol and must one of the following:
187+
:c:data:`Py_eval_input`, :c:data:`Py_file_input`, or :c:data:`Py_single_input`.
187188
188189
Returns the result of executing the code as a Python object, or ``NULL`` if an
189190
exception was raised.
@@ -231,7 +232,7 @@ the same library that the Python runtime is using.
231232
.. c:function:: PyObject* Py_CompileStringObject(const char *str, PyObject *filename, int start, PyCompilerFlags *flags, int optimize)
232233
233234
Parse and compile the Python source code in *str*, returning the resulting code
234-
object. The start token is given by *start*; this can be used to constrain the
235+
object. The start symbol is given by *start*; this can be used to constrain the
235236
code which can be compiled and should be :c:data:`Py_eval_input`,
236237
:c:data:`Py_file_input`, or :c:data:`Py_single_input`. The filename specified by
237238
*filename* is used to construct the code object and may appear in tracebacks or
Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,28 @@
11
Pending removal in Python 3.17
22
------------------------------
33

4+
* :mod:`collections.abc`:
5+
6+
- :class:`collections.abc.ByteString` is scheduled for removal in Python 3.17.
7+
8+
Use ``isinstance(obj, collections.abc.Buffer)`` to test if ``obj``
9+
implements the :ref:`buffer protocol <bufferobjects>` at runtime. For use
10+
in type annotations, either use :class:`~collections.abc.Buffer` or a union
11+
that explicitly specifies the types your code supports (e.g.,
12+
``bytes | bytearray | memoryview``).
13+
14+
:class:`!ByteString` was originally intended to be an abstract class that
15+
would serve as a supertype of both :class:`bytes` and :class:`bytearray`.
16+
However, since the ABC never had any methods, knowing that an object was an
17+
instance of :class:`!ByteString` never actually told you anything useful
18+
about the object. Other common buffer types such as :class:`memoryview`
19+
were also never understood as subtypes of :class:`!ByteString` (either at
20+
runtime or by static type checkers).
21+
22+
See :pep:`PEP 688 <688#current-options>` for more details.
23+
(Contributed by Shantanu Jain in :gh:`91896`.)
24+
25+
426
* :mod:`typing`:
527

628
- Before Python 3.14, old-style unions were implemented using the private class
@@ -9,14 +31,21 @@ Pending removal in Python 3.17
931
3.17. Users should use documented introspection helpers like :func:`typing.get_origin`
1032
and :func:`typing.get_args` instead of relying on private implementation details.
1133
- :class:`typing.ByteString`, deprecated since Python 3.9, is scheduled for removal in
12-
Python 3.17. Prefer :class:`~collections.abc.Sequence` or
13-
:class:`~collections.abc.Buffer`. For use in type annotations, prefer a union, like
14-
``bytes | bytearray``, or :class:`collections.abc.Buffer`.
15-
(Contributed by Shantanu Jain in :gh:`91896`.)
34+
Python 3.17.
1635

17-
* :mod:`collections.abc`:
36+
Use ``isinstance(obj, collections.abc.Buffer)`` to test if ``obj``
37+
implements the :ref:`buffer protocol <bufferobjects>` at runtime. For use
38+
in type annotations, either use :class:`~collections.abc.Buffer` or a union
39+
that explicitly specifies the types your code supports (e.g.,
40+
``bytes | bytearray | memoryview``).
41+
42+
:class:`!ByteString` was originally intended to be an abstract class that
43+
would serve as a supertype of both :class:`bytes` and :class:`bytearray`.
44+
However, since the ABC never had any methods, knowing that an object was an
45+
instance of :class:`!ByteString` never actually told you anything useful
46+
about the object. Other common buffer types such as :class:`memoryview`
47+
were also never understood as subtypes of :class:`!ByteString` (either at
48+
runtime or by static type checkers).
1849

19-
- :class:`collections.abc.ByteString` is scheduled for removal in Python 3.17. Prefer
20-
:class:`~collections.abc.Sequence` or :class:`~collections.abc.Buffer`. For use in
21-
type annotations, prefer a union, like ``bytes | bytearray``, or
22-
:class:`collections.abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.)
50+
See :pep:`PEP 688 <688#current-options>` for more details.
51+
(Contributed by Shantanu Jain in :gh:`91896`.)

_sources/deprecations/pending-removal-in-future.rst.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ although there is currently no date scheduled for their removal.
1515

1616
* :mod:`builtins`:
1717

18-
* ``bool(NotImplemented)``.
1918
* Generators: ``throw(type, exc, tb)`` and ``athrow(type, exc, tb)``
2019
signature is deprecated: use ``throw(exc)`` and ``athrow(exc)`` instead,
2120
the single argument signature.

_sources/extending/extending.rst.txt

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,37 @@ the module and a copyright notice if you like).
7575
See :ref:`arg-parsing-string-and-buffers` for a description of this macro.
7676

7777
All user-visible symbols defined by :file:`Python.h` have a prefix of ``Py`` or
78-
``PY``, except those defined in standard header files. For convenience, and
79-
since they are used extensively by the Python interpreter, ``"Python.h"``
80-
includes a few standard header files: ``<stdio.h>``, ``<string.h>``,
81-
``<errno.h>``, and ``<stdlib.h>``. If the latter header file does not exist on
82-
your system, it declares the functions :c:func:`malloc`, :c:func:`free` and
83-
:c:func:`realloc` directly.
78+
``PY``, except those defined in standard header files.
79+
80+
.. tip::
81+
82+
For backward compatibility, :file:`Python.h` includes several standard header files.
83+
C extensions should include the standard headers that they use,
84+
and should not rely on these implicit includes.
85+
If using the limited C API version 3.13 or newer, the implicit includes are:
86+
87+
* ``<assert.h>``
88+
* ``<intrin.h>`` (on Windows)
89+
* ``<inttypes.h>``
90+
* ``<limits.h>``
91+
* ``<math.h>``
92+
* ``<stdarg.h>``
93+
* ``<wchar.h>``
94+
* ``<sys/types.h>`` (if present)
95+
96+
If :c:macro:`Py_LIMITED_API` is not defined, or is set to version 3.12 or older,
97+
the headers below are also included:
98+
99+
* ``<ctype.h>``
100+
* ``<unistd.h>`` (on POSIX)
101+
102+
If :c:macro:`Py_LIMITED_API` is not defined, or is set to version 3.10 or older,
103+
the headers below are also included:
104+
105+
* ``<errno.h>``
106+
* ``<stdio.h>``
107+
* ``<stdlib.h>``
108+
* ``<string.h>``
84109

85110
The next thing we add to our module file is the C function that will be called
86111
when the Python expression ``spam.system(string)`` is evaluated (we'll see

0 commit comments

Comments
 (0)