Skip to content

Commit 1010690

Browse files
authored
Merge branch 'main' into trampoline_ehframe
2 parents 7b518cb + e66bec0 commit 1010690

176 files changed

Lines changed: 5881 additions & 1789 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/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ Lib/test/test_unittest/testmock/ @cjw296
630630
Doc/library/zlib.rst @StanFromIreland
631631
Lib/compression/zlib.py @StanFromIreland
632632
Lib/test/test_zlib.py @StanFromIreland
633-
Modules/_zlibmodule.c @StanFromIreland
633+
Modules/zlibmodule.c @StanFromIreland
634634

635635
# Zipfile.Path
636636
Lib/test/test_zipfile/_path/ @jaraco

.github/workflows/reusable-docs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ jobs:
8686
--fail-if-regression \
8787
--fail-if-improved \
8888
--fail-if-new-news-nit
89+
- name: 'Build list of changes'
90+
run: |
91+
make -C Doc/ PYTHON=../python changes
8992
- name: 'Collect HTML IDs'
9093
if: github.event_name == 'pull_request'
9194
run: python Doc/tools/check-html-ids.py collect Doc/build/html -o Doc/build/html-ids-head.json.gz
File renamed without changes.
File renamed without changes.
File renamed without changes.

Doc/builtins/index.rst

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
.. _builtins-index:
2+
3+
##############################
4+
Python built-ins reference
5+
##############################
6+
7+
Python comes with a number of built-in functions and classes.
8+
9+
The built-in classes include data types that would normally be considered part
10+
of the "core" of a language, such as numbers and lists. For these types, the
11+
Python language core defines the form of literals and places some constraints
12+
on their semantics, but does not fully define the semantics.
13+
14+
The built-ins also include functions and exceptions --- objects that can
15+
be used by all Python code without the need of an :keyword:`import` statement.
16+
Some of these are defined by the core language, but many are not essential for
17+
the core semantics and are only described here.
18+
19+
.. seealso::
20+
21+
In addition to the built-ins, Python provides an extensive importable
22+
standard library, see :ref:`library-index`.
23+
24+
.. We don't use :numbered: option for the TOC below as it enforces
25+
numbered sections for the entire builtin docs. If desired,
26+
:numbered: can be enabled on a per-page basis.
27+
.. toctree::
28+
:maxdepth: 2
29+
30+
stdtypes.rst
31+
constants.rst
32+
functions.rst
33+
exceptions.rst
34+
threadsafety.rst
35+
time-complexity.rst
File renamed without changes.
File renamed without changes.
File renamed without changes.

Doc/c-api/bytes.rst

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ called with a non-bytes parameter.
231231
Resize a bytes object. *newsize* will be the new length of the bytes object.
232232
You can think of it as creating a new bytes object and destroying the old
233233
one, only more efficiently.
234+
234235
Pass the address of an
235236
existing bytes object as an lvalue (it may be written into), and the new size
236237
desired. On success, *\*bytes* holds the resized bytes object and ``0`` is
@@ -239,6 +240,11 @@ called with a non-bytes parameter.
239240
*\*bytes* is set to ``NULL``, :exc:`MemoryError` is set, and ``-1`` is
240241
returned.
241242
243+
While bytes objects are usually immutable in Python, this special C API
244+
allows mutating a bytes object in-place. The returned bytes object can still
245+
be mutated using :c:func:`PyBytesWriter_GetData`; except if *newsize* is
246+
zero in which case it returns the immutable empty bytes string.
247+
242248
.. soft-deprecated:: 3.15
243249
Use the :c:type:`PyBytesWriter` API instead.
244250
@@ -290,10 +296,10 @@ object.
290296
291297
.. c:type:: PyBytesWriter
292298
293-
A bytes writer instance.
299+
A bytes writer object.
294300
295-
The API is **not thread safe**: a writer should only be used by a single
296-
thread at the same time.
301+
The API is **not thread safe**. A :c:type:`PyBytesWriter` object must only
302+
be used by a single thread, it must not be shared between threads.
297303
298304
The instance must be destroyed by :c:func:`PyBytesWriter_Finish` on
299305
success, or :c:func:`PyBytesWriter_Discard` on error.
@@ -429,7 +435,7 @@ Low-level API
429435
On success, return ``0``.
430436
On error, set an exception and return ``-1``.
431437
432-
*size* can be negative to shrink the writer.
438+
*grow* can be negative to shrink the writer.
433439
434440
.. c:function:: void* PyBytesWriter_GrowAndUpdatePointer(PyBytesWriter *writer, Py_ssize_t size, void *buf)
435441

0 commit comments

Comments
 (0)