mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-30 16:14:24 +08:00
Use TypeAlias where possible for type aliases (#7630)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import datetime
|
||||
from typing_extensions import Literal, TypedDict
|
||||
from typing_extensions import Literal, TypeAlias, TypedDict
|
||||
|
||||
from .date import DateDataParser, _DetectLanguagesFunction
|
||||
|
||||
@@ -7,8 +7,8 @@ __version__: str
|
||||
|
||||
_default_parser: DateDataParser
|
||||
|
||||
_Part = Literal["day", "month", "year"]
|
||||
_ParserKind = Literal["timestamp", "relative-time", "custom-formats", "absolute-time", "no-spaces-time"]
|
||||
_Part: TypeAlias = Literal["day", "month", "year"]
|
||||
_ParserKind: TypeAlias = Literal["timestamp", "relative-time", "custom-formats", "absolute-time", "no-spaces-time"]
|
||||
|
||||
class _Settings(TypedDict, total=False):
|
||||
DATE_ORDER: str
|
||||
|
||||
@@ -3,15 +3,15 @@ from _typeshed import Self as Self
|
||||
from collections.abc import Callable, Iterable, Iterator
|
||||
from datetime import datetime
|
||||
from typing import ClassVar, Pattern, overload
|
||||
from typing_extensions import Literal
|
||||
from typing_extensions import Literal, TypeAlias
|
||||
|
||||
from dateparser import _Settings
|
||||
from dateparser.conf import Settings
|
||||
from dateparser.languages.loader import LocaleDataLoader
|
||||
from dateparser.languages.locale import Locale
|
||||
|
||||
_DetectLanguagesFunction = Callable[[str, float], list[str]]
|
||||
_Period = Literal["time", "day", "week", "month", "year"]
|
||||
_DetectLanguagesFunction: TypeAlias = Callable[[str, float], list[str]]
|
||||
_Period: TypeAlias = Literal["time", "day", "week", "month", "year"]
|
||||
|
||||
APOSTROPHE_LOOK_ALIKE_CHARS: list[str]
|
||||
RE_NBSP: Pattern[str]
|
||||
|
||||
Reference in New Issue
Block a user