mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
Fix signature for __exit__ (#542)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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