mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Backport many Self-related changes to the Python-2 stdlib (#7128)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
from _typeshed import Self
|
||||
from types import TracebackType
|
||||
from typing import Iterator, MutableMapping, Union
|
||||
from typing_extensions import Literal
|
||||
@@ -13,7 +14,7 @@ class _Database(MutableMapping[_KeyType, bytes]):
|
||||
def __iter__(self) -> Iterator[bytes]: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __del__(self) -> None: ...
|
||||
def __enter__(self) -> _Database: ...
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def __exit__(
|
||||
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
|
||||
) -> None: ...
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
from _typeshed import Self
|
||||
from types import TracebackType
|
||||
from typing import Iterator, MutableMapping, Union
|
||||
|
||||
@@ -17,7 +18,7 @@ class _Database(MutableMapping[_KeyType, bytes]):
|
||||
def __iter__(self) -> Iterator[bytes]: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __del__(self) -> None: ...
|
||||
def __enter__(self) -> _Database: ...
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def __exit__(
|
||||
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
|
||||
) -> None: ...
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
from _typeshed import Self
|
||||
from types import TracebackType
|
||||
from typing import TypeVar, Union, overload
|
||||
|
||||
@@ -18,7 +19,7 @@ class _gdbm:
|
||||
def __setitem__(self, key: _KeyType, value: _ValueType) -> None: ...
|
||||
def __delitem__(self, key: _KeyType) -> None: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __enter__(self) -> _gdbm: ...
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def __exit__(
|
||||
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
|
||||
) -> None: ...
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
from _typeshed import Self
|
||||
from types import TracebackType
|
||||
from typing import TypeVar, Union, overload
|
||||
|
||||
@@ -17,7 +18,7 @@ class _dbm:
|
||||
def __delitem__(self, key: _KeyType) -> None: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __del__(self) -> None: ...
|
||||
def __enter__(self) -> _dbm: ...
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def __exit__(
|
||||
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
|
||||
) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user