mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-19 02:15:58 +08:00
Replace Union with union operator (#7596)
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
from collections.abc import Container
|
||||
from typing import Any, Sequence, Union, overload
|
||||
from typing import Any, Sequence, overload
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .Image import Image
|
||||
from .ImageColor import _Ink
|
||||
from .ImageFont import _Font
|
||||
|
||||
_XY = Sequence[Union[float, tuple[float, float]]]
|
||||
_XY = Sequence[float | tuple[float, float]]
|
||||
_Outline = Any
|
||||
|
||||
class ImageDraw:
|
||||
|
||||
@@ -27,7 +27,6 @@ class ContentMetaAttributeValue(AttributeValueWithCharsetSubstitution):
|
||||
def encode(self, encoding: str) -> str: ... # type: ignore[override] # incompatible with str
|
||||
|
||||
_PageElementT = TypeVar("_PageElementT", bound=PageElement)
|
||||
# The wrapping Union[] can be removed once mypy fully supports | in type aliases.
|
||||
_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]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import sys
|
||||
from _typeshed import SupportsWrite
|
||||
from types import TracebackType
|
||||
from typing import Any, Callable, Pattern, Sequence, TextIO, Union
|
||||
from typing import Any, Callable, Pattern, Sequence, TextIO
|
||||
|
||||
if sys.platform == "win32":
|
||||
from .winterm import WinTerm
|
||||
@@ -23,7 +23,7 @@ class StreamWrapper:
|
||||
def closed(self) -> bool: ...
|
||||
|
||||
_WinTermCall = Callable[[int | None, bool, bool], None]
|
||||
_WinTermCallDict = dict[int, Union[tuple[_WinTermCall], tuple[_WinTermCall, int], tuple[_WinTermCall, int, bool]]]
|
||||
_WinTermCallDict = dict[int, tuple[_WinTermCall] | tuple[_WinTermCall, int] | tuple[_WinTermCall, int, bool]]
|
||||
|
||||
class AnsiToWin32:
|
||||
ANSI_CSI_RE: Pattern[str] = ...
|
||||
|
||||
Reference in New Issue
Block a user