diff options
author | Ethan Smith <ethan@ethanhs.me> | 2020-04-09 21:47:31 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-09 21:47:31 -0700 |
commit | e3ec44d692d9442e640cf5b2d8708157a65cec3e (patch) | |
tree | dc16382cb3ae14abfda9fb38257202bb1ab7b3d2 /Lib/fileinput.py | |
parent | 7c4185d62d4aec486d82c3ad02acd878db2d3537 (diff) | |
download | cpython-git-e3ec44d692d9442e640cf5b2d8708157a65cec3e.tar.gz |
bpo-39481: PEP 585 for difflib, filecmp, fileinput (#19422)
Diffstat (limited to 'Lib/fileinput.py')
-rw-r--r-- | Lib/fileinput.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/fileinput.py b/Lib/fileinput.py index c1b0ec9a8e..0c31f93ed8 100644 --- a/Lib/fileinput.py +++ b/Lib/fileinput.py @@ -73,6 +73,7 @@ XXX Possible additions: """ import sys, os +from types import GenericAlias __all__ = ["input", "close", "nextfile", "filename", "lineno", "filelineno", "fileno", "isfirstline", "isstdin", "FileInput", "hook_compressed", @@ -391,6 +392,8 @@ class FileInput: def isstdin(self): return self._isstdin + __class_getitem__ = classmethod(GenericAlias) + def hook_compressed(filename, mode): ext = os.path.splitext(filename)[1] |