Skip to content

Commit 8325906

Browse files
Merge branch 'main' into genericalias-isclass-test
2 parents 0e5d196 + 3dfed23 commit 8325906

Some content is hidden

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

45 files changed

+679
-891
lines changed

Doc/library/cmdline.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _library-cmdline:
2+
13
++++++++++++++++++++++++++++++++++++
24
Modules command-line interface (CLI)
35
++++++++++++++++++++++++++++++++++++

Doc/library/getpass.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
The :mod:`getpass` module provides two functions:
1818

19-
.. function:: getpass(prompt='Password: ', stream=None)
19+
.. function:: getpass(prompt='Password: ', stream=None, *, echo_char=None)
2020

2121
Prompt the user for a password without echoing. The user is prompted using
2222
the string *prompt*, which defaults to ``'Password: '``. On Unix, the
@@ -25,6 +25,12 @@ The :mod:`getpass` module provides two functions:
2525
(:file:`/dev/tty`) or if that is unavailable to ``sys.stderr`` (this
2626
argument is ignored on Windows).
2727

28+
The *echo_char* argument controls how user input is displayed while typing.
29+
If *echo_char* is ``None`` (default), input remains hidden. Otherwise,
30+
*echo_char* must be a printable ASCII string and each typed character
31+
is replaced by it. For example, ``echo_char='*'`` will display
32+
asterisks instead of the actual input.
33+
2834
If echo free input is unavailable getpass() falls back to printing
2935
a warning message to *stream* and reading from ``sys.stdin`` and
3036
issuing a :exc:`GetPassWarning`.
@@ -33,6 +39,9 @@ The :mod:`getpass` module provides two functions:
3339
If you call getpass from within IDLE, the input may be done in the
3440
terminal you launched IDLE from rather than the idle window itself.
3541

42+
.. versionchanged:: next
43+
Added the *echo_char* parameter for keyboard feedback.
44+
3645
.. exception:: GetPassWarning
3746

3847
A :exc:`UserWarning` subclass issued when password input may be echoed.

Doc/library/typing.rst

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,6 +1098,12 @@ These can be used as types in annotations. They all support subscription using
10981098

10991099
Union[Union[int, str], float] == Union[int, str, float]
11001100

1101+
However, this does not apply to unions referenced through a type
1102+
alias, to avoid forcing evaluation of the underlying :class:`TypeAliasType`::
1103+
1104+
type A = Union[int, str]
1105+
Union[A, float] != Union[int, str, float]
1106+
11011107
* Unions of a single argument vanish, e.g.::
11021108

11031109
Union[int] == int # The constructor actually returns int
@@ -1230,6 +1236,32 @@ These can be used as types in annotations. They all support subscription using
12301236
is allowed as type argument to ``Literal[...]``, but type checkers may
12311237
impose restrictions. See :pep:`586` for more details about literal types.
12321238

1239+
Additional details:
1240+
1241+
* The arguments must be literal values and there must be at least one.
1242+
1243+
* Nested ``Literal`` types are flattened, e.g.::
1244+
1245+
assert Literal[Literal[1, 2], 3] == Literal[1, 2, 3]
1246+
1247+
However, this does not apply to ``Literal`` types referenced through a type
1248+
alias, to avoid forcing evaluation of the underlying :class:`TypeAliasType`::
1249+
1250+
type A = Literal[1, 2]
1251+
assert Literal[A, 3] != Literal[1, 2, 3]
1252+
1253+
* Redundant arguments are skipped, e.g.::
1254+
1255+
assert Literal[1, 2, 1] == Literal[1, 2]
1256+
1257+
* When comparing literals, the argument order is ignored, e.g.::
1258+
1259+
assert Literal[1, 2] == Literal[2, 1]
1260+
1261+
* You cannot subclass or instantiate a ``Literal``.
1262+
1263+
* You cannot write ``Literal[X][Y]``.
1264+
12331265
.. versionadded:: 3.8
12341266

12351267
.. versionchanged:: 3.9.1
@@ -1400,6 +1432,14 @@ These can be used as types in annotations. They all support subscription using
14001432
int, ValueRange(3, 10), ctype("char")
14011433
]
14021434

1435+
However, this does not apply to ``Annotated`` types referenced through a type
1436+
alias, to avoid forcing evaluation of the underlying :class:`TypeAliasType`::
1437+
1438+
type From3To10[T] = Annotated[T, ValueRange(3, 10)]
1439+
assert Annotated[From3To10[int], ctype("char")] != Annotated[
1440+
int, ValueRange(3, 10), ctype("char")
1441+
]
1442+
14031443
Duplicated metadata elements are not removed::
14041444

14051445
assert Annotated[int, ValueRange(3, 10)] != Annotated[

Doc/using/configure.rst

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -302,14 +302,21 @@ General Options
302302

303303
.. option:: --enable-experimental-jit=[no|yes|yes-off|interpreter]
304304

305-
Indicate how to integrate the :ref:`JIT compiler <whatsnew313-jit-compiler>`.
306-
307-
* ``no`` - build the interpreter without the JIT.
308-
* ``yes`` - build the interpreter with the JIT.
309-
* ``yes-off`` - build the interpreter with the JIT but disable it by default.
310-
* ``interpreter`` - build the interpreter without the JIT, but with the tier 2 enabled interpreter.
311-
312-
By convention, ``--enable-experimental-jit`` is a shorthand for ``--enable-experimental-jit=yes``.
305+
Indicate how to integrate the :ref:`experimental just-in-time compiler <whatsnew314-jit-compiler>`.
306+
307+
* ``no``: Don't build the JIT.
308+
* ``yes``: Enable the JIT. To disable it at runtime, set the environment
309+
variable :envvar:`PYTHON_JIT=0 <PYTHON_JIT>`.
310+
* ``yes-off``: Build the JIT, but disable it by default. To enable it at
311+
runtime, set the environment variable :envvar:`PYTHON_JIT=1 <PYTHON_JIT>`.
312+
* ``interpreter``: Enable the "JIT interpreter" (only useful for those
313+
debugging the JIT itself). To disable it at runtime, set the environment
314+
variable :envvar:`PYTHON_JIT=0 <PYTHON_JIT>`.
315+
316+
``--enable-experimental-jit=no`` is the default behavior if the option is not
317+
provided, and ``--enable-experimental-jit`` is shorthand for
318+
``--enable-experimental-jit=yes``. See :file:`Tools/jit/README.md` for more
319+
information, including how to install the necessary build-time dependencies.
313320

314321
.. note::
315322

0 commit comments

Comments
 (0)