add annotations to open()

This commit is contained in:
Benjamin Peterson 2009-04-18 14:47:50 +00:00
parent 67d28f774d
commit 9990e8c264
1 changed files with 3 additions and 2 deletions

View File

@ -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.