mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 21:14:48 +08:00
Switch to PEP-604 syntax in python2 stubs (#5915)
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from typing import Any, AnyStr, Iterable, List, Mapping, Sequence, Text, Tuple, Union, overload
|
||||
from typing import Any, AnyStr, Iterable, List, Mapping, Sequence, Text, Tuple, overload
|
||||
|
||||
ascii_letters: str
|
||||
ascii_lowercase: str
|
||||
@@ -48,13 +48,13 @@ class Template:
|
||||
template: Text
|
||||
def __init__(self, template: Text) -> None: ...
|
||||
@overload
|
||||
def substitute(self, mapping: Union[Mapping[str, str], Mapping[unicode, str]] = ..., **kwds: str) -> str: ...
|
||||
def substitute(self, mapping: Mapping[str, str] | Mapping[unicode, str] = ..., **kwds: str) -> str: ...
|
||||
@overload
|
||||
def substitute(self, mapping: Union[Mapping[str, Text], Mapping[unicode, Text]] = ..., **kwds: Text) -> Text: ...
|
||||
def substitute(self, mapping: Mapping[str, Text] | Mapping[unicode, Text] = ..., **kwds: Text) -> Text: ...
|
||||
@overload
|
||||
def safe_substitute(self, mapping: Union[Mapping[str, str], Mapping[unicode, str]] = ..., **kwds: str) -> str: ...
|
||||
def safe_substitute(self, mapping: Mapping[str, str] | Mapping[unicode, str] = ..., **kwds: str) -> str: ...
|
||||
@overload
|
||||
def safe_substitute(self, mapping: Union[Mapping[str, Text], Mapping[unicode, Text]], **kwds: Text) -> Text: ...
|
||||
def safe_substitute(self, mapping: Mapping[str, Text] | Mapping[unicode, Text], **kwds: Text) -> Text: ...
|
||||
|
||||
# TODO(MichalPokorny): This is probably badly and/or loosely typed.
|
||||
class Formatter(object):
|
||||
@@ -62,7 +62,7 @@ class Formatter(object):
|
||||
def vformat(self, format_string: str, args: Sequence[Any], kwargs: Mapping[str, Any]) -> str: ...
|
||||
def parse(self, format_string: str) -> Iterable[Tuple[str, str, str, str]]: ...
|
||||
def get_field(self, field_name: str, args: Sequence[Any], kwargs: Mapping[str, Any]) -> Any: ...
|
||||
def get_value(self, key: Union[int, str], args: Sequence[Any], kwargs: Mapping[str, Any]) -> Any: ...
|
||||
def check_unused_args(self, used_args: Sequence[Union[int, str]], args: Sequence[Any], kwargs: Mapping[str, Any]) -> None: ...
|
||||
def get_value(self, key: int | str, args: Sequence[Any], kwargs: Mapping[str, Any]) -> Any: ...
|
||||
def check_unused_args(self, used_args: Sequence[int | str], args: Sequence[Any], kwargs: Mapping[str, Any]) -> None: ...
|
||||
def format_field(self, value: Any, format_spec: str) -> Any: ...
|
||||
def convert_field(self, value: Any, conversion: str) -> Any: ...
|
||||
|
||||
Reference in New Issue
Block a user