mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-22 03:41:28 +08:00
Big diff: Use new "|" union syntax (#5872)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from _typeshed import Self
|
||||
from types import TracebackType
|
||||
from typing import List, Optional, Type, TypeVar, Union, overload
|
||||
from typing import List, Type, TypeVar, Union, overload
|
||||
|
||||
_T = TypeVar("_T")
|
||||
_KeyType = Union[str, bytes]
|
||||
@@ -20,12 +20,12 @@ class _dbm:
|
||||
def __del__(self) -> None: ...
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def __exit__(
|
||||
self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType]
|
||||
self, exc_type: Type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
|
||||
) -> None: ...
|
||||
@overload
|
||||
def get(self, k: _KeyType) -> Optional[bytes]: ...
|
||||
def get(self, k: _KeyType) -> bytes | None: ...
|
||||
@overload
|
||||
def get(self, k: _KeyType, default: Union[bytes, _T]) -> Union[bytes, _T]: ...
|
||||
def get(self, k: _KeyType, default: bytes | _T) -> bytes | _T: ...
|
||||
def keys(self) -> List[bytes]: ...
|
||||
def setdefault(self, k: _KeyType, default: _ValueType = ...) -> bytes: ...
|
||||
# Don't exist at runtime
|
||||
|
||||
Reference in New Issue
Block a user