Document sys.std* typing (#10135)

This commit is contained in:
Sebastian Rittau
2023-05-03 16:30:37 +02:00
committed by GitHub
parent 8e24885da7
commit 81f6beda9e

View File

@@ -57,9 +57,20 @@ if sys.version_info >= (3, 8):
pycache_prefix: str | None
ps1: object
ps2: object
# TextIO is used instead of more specific types for the standard streams,
# since they are often monkeypatched at runtime. At startup, the objects
# are initialized to instances of TextIOWrapper.
#
# To use methods from TextIOWrapper, use an isinstance check to ensure that
# the streams have not been overridden:
#
# if isinstance(sys.stdout, io.TextIOWrapper):
# sys.stdout.reconfigure(...)
stdin: TextIO
stdout: TextIO
stderr: TextIO
if sys.version_info >= (3, 10):
stdlib_module_names: frozenset[str]