forked from python/typeshed
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstring.pyi
More file actions
68 lines (63 loc) · 3.48 KB
/
Copy pathstring.pyi
File metadata and controls
68 lines (63 loc) · 3.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
from typing import Any, AnyStr, Iterable, List, Mapping, Optional, Sequence, Text, Tuple, Union, overload
ascii_letters: str
ascii_lowercase: str
ascii_uppercase: str
digits: str
hexdigits: str
letters: str
lowercase: str
octdigits: str
punctuation: str
printable: str
uppercase: str
whitespace: str
def capwords(s: AnyStr, sep: AnyStr = ...) -> AnyStr: ...
# TODO: originally named 'from'
def maketrans(_from: str, to: str) -> str: ...
def atof(s: unicode) -> float: ...
def atoi(s: unicode, base: int = ...) -> int: ...
def atol(s: unicode, base: int = ...) -> int: ...
def capitalize(word: AnyStr) -> AnyStr: ...
def find(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ...
def rfind(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ...
def index(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ...
def rindex(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ...
def count(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ...
def lower(s: AnyStr) -> AnyStr: ...
def split(s: AnyStr, sep: AnyStr = ..., maxsplit: int = ...) -> List[AnyStr]: ...
def rsplit(s: AnyStr, sep: AnyStr = ..., maxsplit: int = ...) -> List[AnyStr]: ...
def splitfields(s: AnyStr, sep: AnyStr = ..., maxsplit: int = ...) -> List[AnyStr]: ...
def join(words: Iterable[AnyStr], sep: AnyStr = ...) -> AnyStr: ...
def joinfields(word: Iterable[AnyStr], sep: AnyStr = ...) -> AnyStr: ...
def lstrip(s: AnyStr, chars: AnyStr = ...) -> AnyStr: ...
def rstrip(s: AnyStr, chars: AnyStr = ...) -> AnyStr: ...
def strip(s: AnyStr, chars: AnyStr = ...) -> AnyStr: ...
def swapcase(s: AnyStr) -> AnyStr: ...
def translate(s: str, table: str, deletechars: str = ...) -> str: ...
def upper(s: AnyStr) -> AnyStr: ...
def ljust(s: AnyStr, width: int, fillchar: AnyStr = ...) -> AnyStr: ...
def rjust(s: AnyStr, width: int, fillchar: AnyStr = ...) -> AnyStr: ...
def center(s: AnyStr, width: int, fillchar: AnyStr = ...) -> AnyStr: ...
def zfill(s: AnyStr, width: int) -> AnyStr: ...
def replace(s: AnyStr, old: AnyStr, new: AnyStr, maxreplace: int = ...) -> AnyStr: ...
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: ...
@overload
def substitute(self, mapping: Union[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: ...
@overload
def safe_substitute(self, mapping: Union[Mapping[str, Text], Mapping[unicode, Text]], **kwds: Text) -> Text: ...
# TODO(MichalPokorny): This is probably badly and/or loosely typed.
class Formatter(object):
def format(self, format_string: str, *args, **kwargs) -> str: ...
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 format_field(self, value: Any, format_spec: str) -> Any: ...
def convert_field(self, value: Any, conversion: str) -> Any: ...