Convert typing.ContextManager.exit to use dunder parameter names (#2980)

This commit is contained in:
Mark Mendoza
2019-05-15 13:30:20 -07:00
committed by Jelle Zijlstra
parent 50d98acc76
commit 2cf4af784c
2 changed files with 6 additions and 6 deletions

View File

@@ -237,9 +237,9 @@ class ValuesView(MappingView, Iterable[_VT_co], Generic[_VT_co]):
@runtime
class ContextManager(Protocol[_T_co]):
def __enter__(self) -> _T_co: ...
def __exit__(self, exc_type: Optional[Type[BaseException]],
exc_value: Optional[BaseException],
traceback: Optional[TracebackType]) -> Optional[bool]: ...
def __exit__(self, __exc_type: Optional[Type[BaseException]],
__exc_value: Optional[BaseException],
__traceback: Optional[TracebackType]) -> Optional[bool]: ...
class Mapping(Iterable[_KT], Container[_KT], Generic[_KT, _VT_co]):
# TODO: We wish the key type could also be covariant, but that doesn't work,

View File

@@ -353,9 +353,9 @@ class ValuesView(MappingView, Iterable[_VT_co], Generic[_VT_co]):
@runtime
class ContextManager(Protocol[_T_co]):
def __enter__(self) -> _T_co: ...
def __exit__(self, exc_type: Optional[Type[BaseException]],
exc_value: Optional[BaseException],
traceback: Optional[TracebackType]) -> Optional[bool]: ...
def __exit__(self, __exc_type: Optional[Type[BaseException]],
__exc_value: Optional[BaseException],
__traceback: Optional[TracebackType]) -> Optional[bool]: ...
if sys.version_info >= (3, 5):
@runtime