mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-09 04:52:23 +08:00
Use PEP 604 syntax wherever possible (#7493)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from _typeshed import Self
|
||||
from collections.abc import Iterator
|
||||
from typing import Any, Callable, Generic, Iterable, Pattern, TypeVar, Union, overload
|
||||
from typing import Any, Callable, Generic, Iterable, Pattern, TypeVar, overload
|
||||
|
||||
from . import BeautifulSoup
|
||||
from .builder import TreeBuilder
|
||||
@@ -28,10 +28,10 @@ class ContentMetaAttributeValue(AttributeValueWithCharsetSubstitution):
|
||||
|
||||
_PageElementT = TypeVar("_PageElementT", bound=PageElement)
|
||||
# The wrapping Union[] can be removed once mypy fully supports | in type aliases.
|
||||
_SimpleStrainable = Union[str, bool, None, bytes, Pattern[str], Callable[[str], bool], Callable[[Tag], bool]]
|
||||
_Strainable = Union[_SimpleStrainable, Iterable[_SimpleStrainable]]
|
||||
_SimpleNormalizedStrainable = Union[str, bool, None, Pattern[str], Callable[[str], bool], Callable[[Tag], bool]]
|
||||
_NormalizedStrainable = Union[_SimpleNormalizedStrainable, Iterable[_SimpleNormalizedStrainable]]
|
||||
_SimpleStrainable = str | bool | None | bytes | Pattern[str] | Callable[[str], bool] | Callable[[Tag], bool]
|
||||
_Strainable = _SimpleStrainable | Iterable[_SimpleStrainable]
|
||||
_SimpleNormalizedStrainable = str | bool | None | Pattern[str] | Callable[[str], bool] | Callable[[Tag], bool]
|
||||
_NormalizedStrainable = _SimpleNormalizedStrainable | Iterable[_SimpleNormalizedStrainable]
|
||||
|
||||
class PageElement:
|
||||
parent: Tag | None
|
||||
|
||||
Reference in New Issue
Block a user