Skip to content

Commit 92aef72

Browse files
authored
Merge branch 'python:main' into stackref-is-tagged-int
2 parents a57a599 + 3dfed23 commit 92aef72

File tree

10 files changed

+244
-318
lines changed

10 files changed

+244
-318
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.

0 commit comments

Comments
 (0)