mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-18 14:29:47 +08:00
Use TypeAlias where possible for type aliases (#7630)
This commit is contained in:
@@ -5,6 +5,7 @@ import sys
|
||||
import time
|
||||
from contextlib import AbstractContextManager
|
||||
from typing import IO, Any, Callable, Iterable, Mapping, Sequence, TypeVar
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
import boto.connection
|
||||
|
||||
@@ -15,28 +16,28 @@ if sys.version_info >= (3,):
|
||||
# TODO move _StringIO definition into boto.compat once stubs exist and rename to StringIO
|
||||
import io
|
||||
|
||||
_StringIO = io.StringIO
|
||||
_StringIO: TypeAlias = io.StringIO
|
||||
|
||||
from hashlib import _Hash
|
||||
|
||||
_HashType = _Hash
|
||||
_HashType: TypeAlias = _Hash
|
||||
|
||||
from email.message import Message as _Message
|
||||
else:
|
||||
# TODO move _StringIO definition into boto.compat once stubs exist and rename to StringIO
|
||||
import StringIO
|
||||
|
||||
_StringIO = StringIO.StringIO[Any]
|
||||
_StringIO: TypeAlias = StringIO.StringIO[Any]
|
||||
|
||||
from hashlib import _hash
|
||||
|
||||
_HashType = _hash
|
||||
_HashType: TypeAlias = _hash
|
||||
|
||||
# TODO use email.message.Message once stubs exist
|
||||
_Message = Any
|
||||
_Message: TypeAlias = Any
|
||||
|
||||
_Provider = Any # TODO replace this with boto.provider.Provider once stubs exist
|
||||
_LockType = Any # TODO replace this with _thread.LockType once stubs exist
|
||||
_Provider: TypeAlias = Any # TODO replace this with boto.provider.Provider once stubs exist
|
||||
_LockType: TypeAlias = Any # TODO replace this with _thread.LockType once stubs exist
|
||||
|
||||
JSONDecodeError: type[ValueError]
|
||||
qsa_of_interest: list[str]
|
||||
|
||||
Reference in New Issue
Block a user