Skip to content

Commit 8755cf8

Browse files
Merge branch 'main' into bytes
2 parents 8c1f5ab + 2e64e36 commit 8755cf8

File tree

133 files changed

+4803
-1986
lines changed

Some content is hidden

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

133 files changed

+4803
-1986
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,4 @@ Tools/peg_generator/pegen/grammar_parser.py generated
112112
aclocal.m4 generated
113113
configure generated
114114
*.min.js generated
115+
package-lock.json generated

.github/actionlint.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
self-hosted-runner:
2+
# Pending release of actionlint > 1.7.11 for macos-26-intel support
3+
# https://github.com/rhysd/actionlint/pull/629
4+
labels: ["macos-26-intel"]
5+
16
config-variables: null
27

38
paths:

.github/workflows/build.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -198,16 +198,16 @@ jobs:
198198
strategy:
199199
fail-fast: false
200200
matrix:
201-
# macos-14 is M1, macos-15-intel is Intel.
202-
# macos-15-intel only runs tests against the GIL-enabled CPython.
201+
# macos-26 is Apple Silicon, macos-26-intel is Intel.
202+
# macos-26-intel only runs tests against the GIL-enabled CPython.
203203
os:
204-
- macos-14
205-
- macos-15-intel
204+
- macos-26
205+
- macos-26-intel
206206
free-threading:
207207
- false
208208
- true
209209
exclude:
210-
- os: macos-15-intel
210+
- os: macos-26-intel
211211
free-threading: true
212212
uses: ./.github/workflows/reusable-macos.yml
213213
with:
@@ -336,7 +336,7 @@ jobs:
336336
matrix:
337337
include:
338338
- arch: aarch64
339-
runs-on: macos-14
339+
runs-on: macos-26
340340
- arch: x86_64
341341
runs-on: ubuntu-24.04
342342

@@ -369,7 +369,7 @@ jobs:
369369
sudo xcode-select --switch /Applications/Xcode_15.4.app
370370
371371
- name: Build and test
372-
run: python3 Apple ci iOS --fast-ci --simulator 'iPhone SE (3rd generation),OS=17.5'
372+
run: python3 Platforms/Apple ci iOS --fast-ci --simulator 'iPhone SE (3rd generation),OS=17.5'
373373

374374
build-emscripten:
375375
name: 'Emscripten'

.github/workflows/jit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ jobs:
9999
- false
100100
include:
101101
- target: x86_64-apple-darwin/clang
102-
runner: macos-15-intel
102+
runner: macos-26-intel
103103
- target: aarch64-apple-darwin/clang
104-
runner: macos-14
104+
runner: macos-26
105105
steps:
106106
- uses: actions/checkout@v6
107107
with:

.github/workflows/reusable-macos.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ jobs:
5252
--prefix=/opt/python-dev \
5353
--with-openssl="$(brew --prefix openssl@3.5)"
5454
- name: Build CPython
55-
if : ${{ inputs.free-threading || inputs.os != 'macos-15-intel' }}
55+
if : ${{ inputs.free-threading || inputs.os != 'macos-26-intel' }}
5656
run: gmake -j8
5757
- name: Build CPython for compiler warning check
58-
if : ${{ !inputs.free-threading && inputs.os == 'macos-15-intel' }}
58+
if : ${{ !inputs.free-threading && inputs.os == 'macos-26-intel' }}
5959
run: set -o pipefail; gmake -j8 --output-sync 2>&1 | tee compiler_output_macos.txt
6060
- name: Display build info
6161
run: make pythoninfo
6262
- name: Check compiler warnings
63-
if : ${{ !inputs.free-threading && inputs.os == 'macos-15-intel' }}
63+
if : ${{ !inputs.free-threading && inputs.os == 'macos-26-intel' }}
6464
run: >-
6565
python3 Tools/build/check_warnings.py
6666
--compiler-output-file-path=compiler_output_macos.txt

.github/workflows/tail-call.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ jobs:
6767
matrix:
6868
include:
6969
- target: x86_64-apple-darwin/clang
70-
runner: macos-15-intel
70+
runner: macos-26-intel
7171
- target: aarch64-apple-darwin/clang
72-
runner: macos-14
72+
runner: macos-26
7373
steps:
7474
- uses: actions/checkout@v6
7575
with:

.pre-commit-config.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ repos:
33
rev: a27a2e47c7751b639d2b5badf0ef6ff11fee893f # frozen: v0.15.4
44
hooks:
55
- id: ruff-check
6-
name: Run Ruff (lint) on Apple/
7-
args: [--exit-non-zero-on-fix, --config=Apple/.ruff.toml]
8-
files: ^Apple/
6+
name: Run Ruff (lint) on Platforms/Apple/
7+
args: [--exit-non-zero-on-fix, --config=Platforms/Apple/.ruff.toml]
8+
files: ^Platforms/Apple/
99
- id: ruff-check
1010
name: Run Ruff (lint) on Doc/
1111
args: [--exit-non-zero-on-fix]
@@ -39,9 +39,9 @@ repos:
3939
args: [--exit-non-zero-on-fix, --config=Tools/wasm/.ruff.toml]
4040
files: ^Tools/wasm/
4141
- id: ruff-format
42-
name: Run Ruff (format) on Apple/
43-
args: [--exit-non-zero-on-fix, --config=Apple/.ruff.toml]
44-
files: ^Apple
42+
name: Run Ruff (format) on Platforms/Apple/
43+
args: [--exit-non-zero-on-fix, --config=Platforms/Apple/.ruff.toml]
44+
files: ^Platforms/Apple/
4545
- id: ruff-format
4646
name: Run Ruff (format) on Doc/
4747
args: [--exit-non-zero-on-fix]

Android/android.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,8 @@ async def gradle_task(context):
628628
# Randomization is disabled because order-dependent failures are
629629
# much less likely to pass on a rerun in single-process mode.
630630
"-m", "test",
631-
f"--{context.ci_mode}-ci", "--single-process", "--no-randomize"
631+
f"--{context.ci_mode}-ci", "--single-process", "--no-randomize",
632+
"--pythoninfo",
632633
]
633634

634635
if not any(arg in context.args for arg in ["-c", "-m"]):

Doc/library/array.rst

Lines changed: 37 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
--------------
1010

1111
This module defines an object type which can compactly represent an array of
12-
basic values: characters, integers, floating-point numbers. Arrays are mutable :term:`sequence`
12+
basic values: characters, integers, floating-point numbers, complex numbers. Arrays are mutable :term:`sequence`
1313
types and behave very much like lists, except that the type of objects stored in
1414
them is constrained. The type is specified at object creation time by using a
1515
:dfn:`type code`, which is a single character. The following type codes are
@@ -46,6 +46,11 @@ defined:
4646
+-----------+--------------------+-------------------+-----------------------+-------+
4747
| ``'d'`` | double | float | 8 | |
4848
+-----------+--------------------+-------------------+-----------------------+-------+
49+
| ``'F'`` | float complex | complex | 8 | \(3) |
50+
+-----------+--------------------+-------------------+-----------------------+-------+
51+
| ``'D'`` | double complex | complex | 16 | \(3) |
52+
+-----------+--------------------+-------------------+-----------------------+-------+
53+
4954

5055
Notes:
5156

@@ -63,6 +68,15 @@ Notes:
6368
(2)
6469
.. versionadded:: 3.13
6570

71+
(3)
72+
Complex types (``F`` and ``D``) are available unconditionally,
73+
regardless on support for complex types (the Annex G of the C11 standard)
74+
by the C compiler.
75+
As specified in the C11 standard, each complex type is represented by a
76+
two-element C array containing, respectively, the real and imaginary parts.
77+
78+
.. versionadded:: 3.15
79+
6680
.. seealso::
6781

6882
The :ref:`ctypes <ctypes-fundamental-data-types>` and
@@ -119,9 +133,9 @@ The module defines the following type:
119133
The length in bytes of one array item in the internal representation.
120134

121135

122-
.. method:: append(x)
136+
.. method:: append(value, /)
123137

124-
Append a new item with value *x* to the end of the array.
138+
Append a new item with the specified value to the end of the array.
125139

126140

127141
.. method:: buffer_info()
@@ -146,25 +160,26 @@ The module defines the following type:
146160
.. method:: byteswap()
147161

148162
"Byteswap" all items of the array. This is only supported for values which are
149-
1, 2, 4, or 8 bytes in size; for other types of values, :exc:`RuntimeError` is
163+
1, 2, 4, 8 or 16 bytes in size; for other types of values, :exc:`RuntimeError` is
150164
raised. It is useful when reading data from a file written on a machine with a
151-
different byte order.
165+
different byte order. Note, that for complex types the order of
166+
components (the real part, followed by imaginary part) is preserved.
152167

153168

154-
.. method:: count(x)
169+
.. method:: count(value, /)
155170

156-
Return the number of occurrences of *x* in the array.
171+
Return the number of occurrences of *value* in the array.
157172

158173

159-
.. method:: extend(iterable)
174+
.. method:: extend(iterable, /)
160175

161176
Append items from *iterable* to the end of the array. If *iterable* is another
162177
array, it must have *exactly* the same type code; if not, :exc:`TypeError` will
163178
be raised. If *iterable* is not an array, it must be iterable and its elements
164179
must be the right type to be appended to the array.
165180

166181

167-
.. method:: frombytes(buffer)
182+
.. method:: frombytes(buffer, /)
168183

169184
Appends items from the :term:`bytes-like object`, interpreting
170185
its content as an array of machine values (as if it had been read
@@ -174,55 +189,55 @@ The module defines the following type:
174189
:meth:`!fromstring` is renamed to :meth:`frombytes` for clarity.
175190

176191

177-
.. method:: fromfile(f, n)
192+
.. method:: fromfile(f, n, /)
178193

179194
Read *n* items (as machine values) from the :term:`file object` *f* and append
180195
them to the end of the array. If less than *n* items are available,
181196
:exc:`EOFError` is raised, but the items that were available are still
182197
inserted into the array.
183198

184199

185-
.. method:: fromlist(list)
200+
.. method:: fromlist(list, /)
186201

187202
Append items from the list. This is equivalent to ``for x in list:
188203
a.append(x)`` except that if there is a type error, the array is unchanged.
189204

190205

191-
.. method:: fromunicode(s)
206+
.. method:: fromunicode(ustr, /)
192207

193208
Extends this array with data from the given Unicode string.
194209
The array must have type code ``'u'`` or ``'w'``; otherwise a :exc:`ValueError` is raised.
195210
Use ``array.frombytes(unicodestring.encode(enc))`` to append Unicode data to an
196211
array of some other type.
197212

198213

199-
.. method:: index(x[, start[, stop]])
214+
.. method:: index(value[, start[, stop]])
200215

201216
Return the smallest *i* such that *i* is the index of the first occurrence of
202-
*x* in the array. The optional arguments *start* and *stop* can be
203-
specified to search for *x* within a subsection of the array. Raise
204-
:exc:`ValueError` if *x* is not found.
217+
*value* in the array. The optional arguments *start* and *stop* can be
218+
specified to search for *value* within a subsection of the array. Raise
219+
:exc:`ValueError` if *value* is not found.
205220

206221
.. versionchanged:: 3.10
207222
Added optional *start* and *stop* parameters.
208223

209224

210-
.. method:: insert(i, x)
225+
.. method:: insert(index, value, /)
211226

212-
Insert a new item with value *x* in the array before position *i*. Negative
227+
Insert a new item *value* in the array before position *index*. Negative
213228
values are treated as being relative to the end of the array.
214229

215230

216-
.. method:: pop([i])
231+
.. method:: pop(index=-1, /)
217232

218233
Removes the item with the index *i* from the array and returns it. The optional
219234
argument defaults to ``-1``, so that by default the last item is removed and
220235
returned.
221236

222237

223-
.. method:: remove(x)
238+
.. method:: remove(value, /)
224239

225-
Remove the first occurrence of *x* from the array.
240+
Remove the first occurrence of *value* from the array.
226241

227242

228243
.. method:: clear()
@@ -247,7 +262,7 @@ The module defines the following type:
247262
:meth:`!tostring` is renamed to :meth:`tobytes` for clarity.
248263

249264

250-
.. method:: tofile(f)
265+
.. method:: tofile(f, /)
251266

252267
Write all items (as machine values) to the :term:`file object` *f*.
253268

0 commit comments

Comments
 (0)