mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-10-03 00:13:46 +08:00
Fix signature for __exit__ (#542)
This commit is contained in:
1 parent
94e0625e82
commit
8b0e6b886d
2 files changed
+6
-2
No files matched your search
@@ -261,7 +261,9 @@ class IO(Iterator[AnyStr], Generic[AnyStr]):
|
||||
@abstractmethod
|
||||
def __enter__(self) -> 'IO[AnyStr]': ...
|
||||
@abstractmethod
|
||||
def __exit__(self, t: type, value: Any, traceback: Any) -> bool: ...
|
||||
def __exit__(self, t: Optional[Type[BaseException]], value: Optional[BaseException],
|
||||
# TODO: traceback should be TracebackType but that's defined in types
|
||||
traceback: Optional[Any]) -> bool: ...
|
||||
|
||||
class BinaryIO(IO[str]):
|
||||
# TODO readinto
|
||||
|
||||
+3
-1
@@ -319,7 +319,9 @@ class IO(Iterator[AnyStr], Generic[AnyStr]):
|
||||
@abstractmethod
|
||||
def __enter__(self) -> 'IO[AnyStr]': ...
|
||||
@abstractmethod
|
||||
def __exit__(self, t: type = None, value: BaseException = None, traceback: Any = None) -> bool: ...
|
||||
def __exit__(self, t: Optional[Type[BaseException]], value: Optional[BaseException],
|
||||
# TODO: traceback should be TracebackType but that's defined in types
|
||||
traceback: Optional[Any]) -> bool: ...
|
||||
|
||||
class BinaryIO(IO[bytes]):
|
||||
# TODO readinto
|
||||
|
||||
Reference in new issue
Block a user