From e3ec44d692d9442e640cf5b2d8708157a65cec3e Mon Sep 17 00:00:00 2001 From: Ethan Smith Date: Thu, 9 Apr 2020 21:47:31 -0700 Subject: bpo-39481: PEP 585 for difflib, filecmp, fileinput (#19422) --- Lib/fileinput.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Lib/fileinput.py') 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] -- cgit v1.2.1