From: Benjamin Peterson Date: Sat, 18 Apr 2009 14:47:50 +0000 (+0000) Subject: add annotations to open() X-Git-Tag: v3.1b1~248 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9990e8c264226f2b6b4883c28ced6437ce4d2b49;p=thirdparty%2FPython%2Fcpython.git add annotations to open() --- diff --git a/Lib/_pyio.py b/Lib/_pyio.py index 3fd1afedde7b..0ef6822044d6 100644 --- a/Lib/_pyio.py +++ b/Lib/_pyio.py @@ -35,8 +35,9 @@ class BlockingIOError(IOError): self.characters_written = characters_written -def open(file, mode="r", buffering=None, encoding=None, errors=None, - newline=None, closefd=True): +def open(file: (str, bytes), mode: str = "r", buffering: int = None, + encoding: str = None, errors: str = None, + newline: str = None, closefd: bool = True) -> "IOBase": r"""Open file and return a stream. Raise IOError upon failure.