mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-20 08:38:26 +08:00
Big diff: Use new "|" union syntax (#5872)
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import string
|
||||
import sys
|
||||
from typing import Any, Callable, Iterable, Mapping, Optional, Sequence, Text, Tuple, Union
|
||||
from typing import Any, Callable, Iterable, Mapping, Sequence, Text, Tuple
|
||||
from typing_extensions import SupportsIndex
|
||||
|
||||
from markupsafe._compat import text_type
|
||||
from markupsafe._native import escape as escape, escape_silent as escape_silent, soft_unicode as soft_unicode
|
||||
|
||||
class Markup(text_type):
|
||||
def __new__(cls, base: Text = ..., encoding: Optional[Text] = ..., errors: Text = ...) -> Markup: ...
|
||||
def __new__(cls, base: Text = ..., encoding: Text | None = ..., errors: Text = ...) -> Markup: ...
|
||||
def __html__(self) -> Markup: ...
|
||||
def __add__(self, other: text_type) -> Markup: ...
|
||||
def __radd__(self, other: text_type) -> Markup: ...
|
||||
@@ -15,8 +15,8 @@ class Markup(text_type):
|
||||
def __rmul__(self, num: int) -> Markup: ... # type: ignore
|
||||
def __mod__(self, *args: Any) -> Markup: ...
|
||||
def join(self, seq: Iterable[text_type]) -> Markup: ...
|
||||
def split(self, sep: Optional[text_type] = ..., maxsplit: SupportsIndex = ...) -> list[Markup]: ... # type: ignore
|
||||
def rsplit(self, sep: Optional[text_type] = ..., maxsplit: SupportsIndex = ...) -> list[Markup]: ... # type: ignore
|
||||
def split(self, sep: text_type | None = ..., maxsplit: SupportsIndex = ...) -> list[Markup]: ... # type: ignore
|
||||
def rsplit(self, sep: text_type | None = ..., maxsplit: SupportsIndex = ...) -> list[Markup]: ... # type: ignore
|
||||
def splitlines(self, keepends: bool = ...) -> list[Markup]: ... # type: ignore
|
||||
def unescape(self) -> Text: ...
|
||||
def striptags(self) -> Text: ...
|
||||
@@ -27,7 +27,7 @@ class Markup(text_type):
|
||||
def format(self, *args: Any, **kwargs: Any) -> Markup: ...
|
||||
def __html_format__(self, format_spec: text_type) -> Markup: ...
|
||||
def __getslice__(self, start: int, stop: int) -> Markup: ...
|
||||
def __getitem__(self, i: Union[int, slice]) -> Markup: ...
|
||||
def __getitem__(self, i: int | slice) -> Markup: ...
|
||||
def capitalize(self) -> Markup: ...
|
||||
def title(self) -> Markup: ...
|
||||
def lower(self) -> Markup: ...
|
||||
@@ -36,14 +36,12 @@ class Markup(text_type):
|
||||
def replace(self, old: text_type, new: text_type, count: SupportsIndex = ...) -> Markup: ...
|
||||
def ljust(self, width: SupportsIndex, fillchar: text_type = ...) -> Markup: ...
|
||||
def rjust(self, width: SupportsIndex, fillchar: text_type = ...) -> Markup: ...
|
||||
def lstrip(self, chars: Optional[text_type] = ...) -> Markup: ...
|
||||
def rstrip(self, chars: Optional[text_type] = ...) -> Markup: ...
|
||||
def strip(self, chars: Optional[text_type] = ...) -> Markup: ...
|
||||
def lstrip(self, chars: text_type | None = ...) -> Markup: ...
|
||||
def rstrip(self, chars: text_type | None = ...) -> Markup: ...
|
||||
def strip(self, chars: text_type | None = ...) -> Markup: ...
|
||||
def center(self, width: SupportsIndex, fillchar: text_type = ...) -> Markup: ...
|
||||
def zfill(self, width: SupportsIndex) -> Markup: ...
|
||||
def translate(
|
||||
self, table: Union[Mapping[int, Union[int, text_type, None]], Sequence[Union[int, text_type, None]]]
|
||||
) -> Markup: ...
|
||||
def translate(self, table: Mapping[int, int | text_type | None] | Sequence[int | text_type | None]) -> Markup: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
def expandtabs(self, tabsize: SupportsIndex = ...) -> Markup: ...
|
||||
else:
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
from typing import Text, Union
|
||||
from typing import Text
|
||||
|
||||
from . import Markup
|
||||
from ._compat import text_type
|
||||
|
||||
def escape(s: Union[Markup, Text]) -> Markup: ...
|
||||
def escape_silent(s: Union[None, Markup, Text]) -> Markup: ...
|
||||
def escape(s: Markup | Text) -> Markup: ...
|
||||
def escape_silent(s: None | Markup | Text) -> Markup: ...
|
||||
def soft_unicode(s: Text) -> text_type: ...
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
from typing import Text, Union
|
||||
from typing import Text
|
||||
|
||||
from . import Markup
|
||||
from ._compat import text_type
|
||||
|
||||
def escape(s: Union[Markup, Text]) -> Markup: ...
|
||||
def escape_silent(s: Union[None, Markup, Text]) -> Markup: ...
|
||||
def escape(s: Markup | Text) -> Markup: ...
|
||||
def escape_silent(s: None | Markup | Text) -> Markup: ...
|
||||
def soft_unicode(s: Text) -> text_type: ...
|
||||
|
||||
Reference in New Issue
Block a user