Use _typeshed.Self with __enter__ (#5719)

This commit is contained in:
Anton Grübel
2021-07-01 23:15:13 +02:00
committed by GitHub
parent 96e0660fba
commit 8a107464a8
11 changed files with 30 additions and 45 deletions

View File

@@ -1,3 +1,4 @@
from _typeshed import Self
from types import TracebackType
from typing import Any, Optional, Tuple, Type, Union
@@ -90,7 +91,7 @@ error = OSError
class HKEYType:
def __bool__(self) -> bool: ...
def __int__(self) -> int: ...
def __enter__(self) -> HKEYType: ...
def __enter__(self: Self) -> Self: ...
def __exit__(
self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType]
) -> Optional[bool]: ...