mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
stdlib: Improve a bunch of __(a)exit__ methods (#7571)
This commit is contained in:
@@ -217,9 +217,9 @@ if sys.version_info >= (3, 10):
|
||||
@overload
|
||||
def __init__(self: nullcontext[_T], enter_result: _T) -> None: ...
|
||||
def __enter__(self) -> _T: ...
|
||||
def __exit__(self, *exctype: Any) -> None: ...
|
||||
def __exit__(self, *exctype: object) -> None: ...
|
||||
async def __aenter__(self) -> _T: ...
|
||||
async def __aexit__(self, *exctype: Any) -> None: ...
|
||||
async def __aexit__(self, *exctype: object) -> None: ...
|
||||
|
||||
elif sys.version_info >= (3, 7):
|
||||
class nullcontext(AbstractContextManager[_T]):
|
||||
@@ -229,7 +229,7 @@ elif sys.version_info >= (3, 7):
|
||||
@overload
|
||||
def __init__(self: nullcontext[_T], enter_result: _T) -> None: ...
|
||||
def __enter__(self) -> _T: ...
|
||||
def __exit__(self, *exctype: Any) -> None: ...
|
||||
def __exit__(self, *exctype: object) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
_T_fd_or_any_path = TypeVar("_T_fd_or_any_path", bound=int | StrOrBytesPath)
|
||||
|
||||
Reference in New Issue
Block a user