mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 04:34:28 +08:00
Use TypeAlias where possible for type aliases (#7630)
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
from datetime import datetime, tzinfo
|
||||
from typing import IO, Any, Mapping, Text
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
from .isoparser import isoparse as isoparse, isoparser as isoparser
|
||||
|
||||
_FileOrStr = bytes | Text | IO[str] | IO[Any]
|
||||
_FileOrStr: TypeAlias = bytes | Text | IO[str] | IO[Any]
|
||||
|
||||
class parserinfo(object):
|
||||
JUMP: list[str]
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
from _typeshed import SupportsRead
|
||||
from datetime import date, datetime, time, tzinfo
|
||||
from typing import Text
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
_Readable = SupportsRead[Text | bytes]
|
||||
_TakesAscii = Text | bytes | _Readable
|
||||
_Readable: TypeAlias = SupportsRead[Text | bytes]
|
||||
_TakesAscii: TypeAlias = Text | bytes | _Readable
|
||||
|
||||
class isoparser:
|
||||
def __init__(self, sep: Text | bytes | None = ...): ...
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import datetime
|
||||
from typing import IO, Any, Text, TypeVar
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
from ..relativedelta import relativedelta
|
||||
from ._common import _tzinfo as _tzinfo, enfold as enfold, tzname_in_python2 as tzname_in_python2, tzrangebase as tzrangebase
|
||||
|
||||
_FileObj = str | Text | IO[str] | IO[Text]
|
||||
_FileObj: TypeAlias = str | Text | IO[str] | IO[Text]
|
||||
_DT = TypeVar("_DT", bound=datetime.datetime)
|
||||
|
||||
ZERO: datetime.timedelta
|
||||
|
||||
Reference in New Issue
Block a user