mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-11 09:08:27 +08:00
Use TypeAlias for type aliases where possible, part II (#7667)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from collections.abc import Iterable, Mapping
|
||||
from typing import Any
|
||||
from typing_extensions import TypeAlias
|
||||
from urllib.parse import ParseResult, SplitResult
|
||||
|
||||
from requests.auth import AuthBase
|
||||
@@ -9,7 +10,7 @@ from requests.structures import CaseInsensitiveDict
|
||||
from .lib.url import URL
|
||||
from .objects import Calendar, DAVObject, Principal
|
||||
|
||||
_Element = Any # actually lxml.etree._Element
|
||||
_Element: TypeAlias = Any # actually lxml.etree._Element
|
||||
|
||||
class DAVResponse:
|
||||
reason: str
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
from _typeshed import Self
|
||||
from collections.abc import Iterable
|
||||
from typing import Any, ClassVar
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
_Element = Any # actually lxml.etree._Element
|
||||
_Element: TypeAlias = Any # actually lxml.etree._Element
|
||||
|
||||
class BaseElement:
|
||||
tag: ClassVar[str | None]
|
||||
|
||||
@@ -2,7 +2,7 @@ import datetime
|
||||
from _typeshed import Self
|
||||
from collections.abc import Iterable, Iterator, Mapping
|
||||
from typing import Any, TypeVar, overload
|
||||
from typing_extensions import Literal
|
||||
from typing_extensions import Literal, TypeAlias
|
||||
from urllib.parse import ParseResult, SplitResult
|
||||
|
||||
from vobject.base import VBase
|
||||
@@ -13,7 +13,7 @@ from .lib.url import URL
|
||||
|
||||
_CC = TypeVar("_CC", bound=CalendarObjectResource)
|
||||
|
||||
_vCalAddress = Any # actually icalendar.vCalAddress
|
||||
_vCalAddress: TypeAlias = Any # actually icalendar.vCalAddress
|
||||
|
||||
class DAVObject:
|
||||
id: str | None
|
||||
|
||||
Reference in New Issue
Block a user