Use TypeAlias for type aliases where possible, part II (#7667)

This commit is contained in:
Alex Waygood
2022-04-20 20:02:47 +01:00
committed by GitHub
parent c653be73b8
commit b093c90a94
41 changed files with 91 additions and 90 deletions
+2 -1
View File
@@ -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
+2 -1
View File
@@ -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 -2
View File
@@ -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