8000 Merge branch 'main' into add-warning-options-and-include-in-check-war… · python/cpython@a0f8fd5 · GitHub
[go: up one dir, main page]

Skip to content

Commit a0f8fd5

Browse files
committed
Merge branch 'main' into add-warning-options-and-include-in-check-warnings
2 parents 207a664 + ce39d3c commit a0f8fd5

File tree

126 files changed

+13106
-5962
lines changed

Some content is hidden

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

126 files changed

+13106
-5962
lines changed

.devcontainer/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM docker.io/library/fedora:40
22

33
ENV CC=clang
44

5-
ENV WASI_SDK_VERSION=22
5+
ENV WASI_SDK_VERSION=24
66
ENV WASI_SDK_PATH=/opt/wasi-sdk
77

88
ENV WASMTIME_HOME=/opt/wasmtime
@@ -14,7 +14,7 @@ RUN dnf -y --nodocs --setopt=install_weak_deps=False install /usr/bin/{blurb,cla
1414
dnf -y clean all
1515

1616
RUN mkdir ${WASI_SDK_PATH} && \
17-
curl --location https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VERSION}/wasi-sdk-${WASI_SDK_VERSION}.0-linux.tar.gz | \
17+
curl --location https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VERSION}/wasi-sdk-${WASI_SDK_VERSION}.0-x86_64-linux.tar.gz | \
1818
tar --strip-components 1 --directory ${WASI_SDK_PATH} --extract --gunzip
1919

2020
RUN mkdir --parents ${WASMTIME_HOME} && \

.github/workflows/reusable-wasi.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-22.04
1313
env:
1414
WASMTIME_VERSION: 22.0.0
15-
WASI_SDK_VERSION: 22
15+
WASI_SDK_VERSION: 24
1616
WASI_SDK_PATH: /opt/wasi-sdk
1717
CROSS_BUILD_PYTHON: cross-build/build
1818
CROSS_BUILD_WASI: cross-build/wasm32-wasi
@@ -33,7 +33,7 @@ jobs:
3333
if: steps.cache-wasi-sdk.outputs.cache-hit != 'true'
3434
run: |
3535
mkdir ${{ env.WASI_SDK_PATH }} && \
36-
curl -s -S --location https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${{ env.WASI_SDK_VERSION }}/wasi-sdk-${{ env.WASI_SDK_VERSION }}.0-linux.tar.gz | \
36+
curl -s -S --location https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${{ env.WASI_SDK_VERSION }}/wasi-sdk-${{ env.WASI_SDK_VERSION }}.0-x86_64-linux.tar.gz | \
3737
tar --strip-components 1 --directory ${{ env.WASI_SDK_PATH }} --extract --gunzip
3838
- name: "Configure ccache action"
3939
uses: hendrikmuhs/ccache-action@v1.2

Doc/c-api/module.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ The available slot types are:
433433
This slot is ignored by Python builds not configured with
434434
:option:`--disable-gil`. Otherwise, it determines whether or not importing
435435
this module will cause the GIL to be automatically enabled. See
436-
:ref:`free-threaded-cpython` for more detail.
436+
:ref:`whatsnew313-free-threaded-cpython` for more detail.
437437
438438
Multiple ``Py_mod_gil`` slots may not be specified in one module definition.
439439

Doc/library/cmdline.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The following modules have a command-line interface.
2323
* :ref:`http.server <http-server-cli>`
2424
* :mod:`!idlelib`
2525
* :ref:`inspect <inspect-module-cli>`
26-
* :ref:`json.tool <json-commandline>`
26+
* :ref:`json <json-commandline>`
2727
* :mod:`mimetypes`
2828
* :mod:`pdb`
2929
* :mod:`pickle`

Doc/library/json.rst

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,15 @@ Extending :class:`JSONEncoder`::
116116
['[2.0', ', 1.0', ']']
117117

118118

119-
Using :mod:`json.tool` from the shell to validate and pretty-print:
119+
Using :mod:`json` from the shell to validate and pretty-print:
120120

121121
.. code-block:: shell-session
122122
123-
$ echo '{"json":"obj"}' | python -m json.tool
123+
$ echo '{"json":"obj"}' | python -m json
124124
{
125125
"json": "obj"
126126
}
127-
$ echo '{1.2:3.4}' | python -m json.tool
127+
$ echo '{1.2:3.4}' | python -m json
128128
Expecting property name enclosed in double quotes: line 1 column 2 (char 1)
129129
130130
See :ref:`json-commandline` for detailed documentation.
@@ -678,40 +678,46 @@ when serializing instances of "exotic" numerical types such as
678678

679679

680680
.. _json-commandline:
681-
.. program:: json.tool
681+
.. program:: json
682682

683-
Command Line Interface
683+
Command-line interface
684684
----------------------
685685

686686
.. module:: json.tool
687-
:synopsis: A command line to validate and pretty-print JSON.
687+
:synopsis: A command-line interface to validate and pretty-print JSON.
688688

689689
**Source code:** :source:`Lib/json/tool.py`
690690

691691
--------------
692692

693-
The :mod:`json.tool` module provides a simple command line interface to validate
694-
and pretty-print JSON objects.
693+
The :mod:`json` module can be invoked as a script via ``python -m json``
694+
to validate and pretty-print JSON objects. The :mod:`json.tool` submodule
695+
implements this interface.
695696

696697
If the optional ``infile`` and ``outfile`` arguments are not
697698
specified, :data:`sys.stdin` and :data:`sys.stdout` will be used respectively:
698699

699700
.. code-block:: shell-session
700701
701-
$ echo '{"json": "obj"}' | python -m json.tool
702+
$ echo '{"json": "obj"}' | python -m json
702703
{
703704
"json": "obj"
704705
}
705-
$ echo '{1.2:3.4}' | python -m json.tool
706+
$ echo '{1.2:3.4}' | python -m json
706707
Expecting property name enclosed in double quotes: line 1 column 2 (char 1)
707708
708709
.. versionchanged:: 3.5
709710
The output is now in the same order as the input. Use the
710711
:option:`--sort-keys` option to sort the output of dictionaries
711712
alphabetically by key.
712713

714+
.. versionchanged:: 3.14
715+
The :mod:`json` module may now be directly executed as
716+
``python -m json``. For backwards compatibility, invoking
717+
the CLI as ``python -m json.tool`` remains supported.
713718

714-
Command line options
719+
720+
Command-line options
715721
^^^^^^^^^^^^^^^^^^^^
716722

717723
.. option:: infile
@@ -720,7 +726,7 @@ Command line options
720726

721727
.. code-block:: shell-session
722728
723-
$ python -m json.tool mp_films.json
729+
$ python -m json mp_films.json
724730
[
725731
{
726732
"title": "And Now for Something Completely Different",

Doc/tutorial/controlflow.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ they appear in the sequence. For example (no pun intended):
6161
::
6262

6363
>>> # Measure some strings:
64-
... words = ['cat', 'window', 'defenestrate']
64+
>>> words = ['cat', 'window', 'defenestrate']
6565
>>> for w in words:
6666
... print(w, len(w))
6767
...
@@ -445,7 +445,7 @@ boundary::
445445
... print()
446446
...
447447
>>> # Now call the function we just defined:
448-
... fib(2000)
448+
>>> fib(2000)
449449
0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597
450450

451451
.. index::

Doc/tutorial/datastructures.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -383,16 +383,16 @@ A tuple consists of a number of values separated by commas, for instance::
383383
>>> t
384384
(12345, 54321, 'hello!')
385385
>>> # Tuples may be nested:
386-
... u = t, (1, 2, 3, 4, 5)
386+
>>> u = t, (1, 2, 3, 4, 5)
387387
>>> u
388388
((12345, 54321, 'hello!'), (1, 2, 3, 4, 5))
389389
>>> # Tuples are immutable:
390-
... t[0] = 88888
390+
>>> t[0] = 88888
391391
Traceback (most recent call last):
392392
File "<stdin>", line 1, in <module>
393393
TypeError: 'tuple' object does not support item assignment
394394
>>> # but they can contain mutable objects:
395-
... v = ([1, 2, 3], [3, 2, 1])
395+
>>> v = ([1, 2, 3], [3, 2, 1])
396396
>>> v
397397
([1, 2, 3], [3, 2, 1])
398398

@@ -465,7 +465,7 @@ Here is a brief demonstration::
465465
False
466466

467467
>>> # Demonstrate set operations on unique letters from two words
468-
...
468+
>>>
469469
>>> a = set('abracadabra')
470470
>>> b = set('alacazam')
471471
>>> a # unique letters in a

Doc/tutorial/inputoutput.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,12 @@ Some examples::
8787
>>> print(s)
8888
The value of x is 32.5, and y is 40000...
8989
>>> # The repr() of a string adds string quotes and backslashes:
90-
... hello = 'hello, world\n'
90+
>>> hello = 'hello, world\n'
9191
>>> hellos = repr(hello)
9292
>>> print(hellos)
9393
'hello, world\n'
9494
>>> # The argument to repr() may be any Python object:
95-
... repr((x, y, ('spam', 'eggs')))
95+
>>> repr((x, y, ('spam', 'eggs')))
9696
"(32.5, 40000, ('spam', 'eggs'))"
9797

9898
The :mod:`string` module contains a :class:`~string.Template` class that offers

Doc/tutorial/introduction.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,8 +501,8 @@ together. For instance, we can write an initial sub-sequence of the
501501
as follows::
502502

503503
>>> # Fibonacci series:
504-
... # the sum of two elements defines the next
505-
... a, b = 0, 1
504+
>>> # the sum of two elements defines the next
505+
>>> a, b = 0, 1
506506
>>> while a < 10:
507507
... print(a)
508508
... a, b = b, a+b

Doc/using/cmdline.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ Miscellaneous options
624624
* :samp:`-X gil={0,1}` forces the GIL to be disabled or enabled,
625625
respectively. Only available in builds configured with
626626
:option:`--disable-gil`. See also :envvar:`PYTHON_GIL` and
627-
:ref:`free-threaded-cpython`.
627+
:ref:`whatsnew313-free-threaded-cpython`.
628628

629629
.. versionadded:: 3.13
630630

@@ -1224,7 +1224,7 @@ conflict.
12241224
forced on. Setting it to ``0`` forces the GIL off.
12251225

12261226
See also the :option:`-X gil <-X>` command-line option, which takes
1227-
precedence over this variable, and :ref:`free-threaded-cpython`.
1227+
precedence over this variable, and :ref:`whatsnew313-free-threaded-cpython`.
12281228

12291229
Needs Python configured with the :option:`--disable-gil` build option.
12301230

Doc/using/configure.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ General Options
299299
Defines the ``Py_GIL_DISABLED`` macro and adds ``"t"`` to
300300
:data:`sys.abiflags`.
301301

302-
See :ref:`free-threaded-cpython` for more detail.
302+
See :ref:`whatsnew313-free-threaded-cpython` for more detail.
303303

304304
.. versionadded:: 3.13
305305

0 commit comments

Comments
 (0)
0