massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / coc-python-data / languageServer.0.5.59 / Typeshed / stdlib / 2 / string.pyi
1 # Stubs for string\r
2 \r
3 # Based on http://docs.python.org/3.2/library/string.html\r
4 \r
5 from typing import Mapping, Sequence, Any, Optional, Union, List, Tuple, Iterable, AnyStr\r
6 \r
7 ascii_letters = ...  # type: str\r
8 ascii_lowercase = ...  # type: str\r
9 ascii_uppercase = ...  # type: str\r
10 digits = ...  # type: str\r
11 hexdigits = ...  # type: str\r
12 letters = ...  # type: str\r
13 lowercase = ...  # type: str\r
14 octdigits = ...  # type: str\r
15 punctuation = ...  # type: str\r
16 printable = ...  # type: str\r
17 uppercase = ...  # type: str\r
18 whitespace = ...  # type: str\r
19 \r
20 def capwords(s: AnyStr, sep: AnyStr = ...) -> AnyStr: ...\r
21 # TODO: originally named 'from'\r
22 def maketrans(_from: str, to: str) -> str: ...\r
23 def atof(s: unicode) -> float: ...\r
24 def atoi(s: unicode, base: int = ...) -> int: ...\r
25 def atol(s: unicode, base: int = ...) -> int: ...\r
26 def capitalize(word: AnyStr) -> AnyStr: ...\r
27 def find(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ...\r
28 def rfind(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ...\r
29 def index(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ...\r
30 def rindex(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ...\r
31 def count(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ...\r
32 def lower(s: AnyStr) -> AnyStr: ...\r
33 def split(s: AnyStr, sep: AnyStr = ..., maxsplit: int = ...) -> List[AnyStr]: ...\r
34 def rsplit(s: AnyStr, sep: AnyStr = ..., maxsplit: int = ...) -> List[AnyStr]: ...\r
35 def splitfields(s: AnyStr, sep: AnyStr = ..., maxsplit: int = ...) -> List[AnyStr]: ...\r
36 def join(words: Iterable[AnyStr], sep: AnyStr = ...) -> AnyStr: ...\r
37 def joinfields(word: Iterable[AnyStr], sep: AnyStr = ...) -> AnyStr: ...\r
38 def lstrip(s: AnyStr, chars: AnyStr = ...) -> AnyStr: ...\r
39 def rstrip(s: AnyStr, chars: AnyStr = ...) -> AnyStr: ...\r
40 def strip(s: AnyStr, chars: AnyStr = ...) -> AnyStr: ...\r
41 def swapcase(s: AnyStr) -> AnyStr: ...\r
42 def translate(s: str, table: str, deletechars: str = ...) -> str: ...\r
43 def upper(s: AnyStr) -> AnyStr: ...\r
44 def ljust(s: AnyStr, width: int, fillchar: AnyStr = ...) -> AnyStr: ...\r
45 def rjust(s: AnyStr, width: int, fillchar: AnyStr = ...) -> AnyStr: ...\r
46 def center(s: AnyStr, width: int, fillchar: AnyStr = ...) -> AnyStr: ...\r
47 def zfill(s: AnyStr, width: int) -> AnyStr: ...\r
48 def replace(s: AnyStr, old: AnyStr, new: AnyStr, maxreplace: int = ...) -> AnyStr: ...\r
49 \r
50 class Template(object):\r
51     # TODO: Unicode support?\r
52     template = ...  # type: str\r
53 \r
54     def __init__(self, template: str) -> None: ...\r
55     def substitute(self, mapping: Mapping[str, str] = ..., **kwds: str) -> str: ...\r
56     def safe_substitute(self, mapping: Mapping[str, str] = ...,\r
57                         **kwds: str) -> str: ...\r
58 \r
59 # TODO(MichalPokorny): This is probably badly and/or loosely typed.\r
60 class Formatter(object):\r
61     def format(self, format_string: str, *args, **kwargs) -> str: ...\r
62     def vformat(self, format_string: str, args: Sequence[Any],\r
63                 kwargs: Mapping[str, Any]) -> str: ...\r
64     def parse(self, format_string: str) -> Iterable[Tuple[str, str, str, str]]: ...\r
65     def get_field(self, field_name: str, args: Sequence[Any],\r
66                   kwargs: Mapping[str, Any]) -> Any: ...\r
67     def get_value(self, key: Union[int, str], args: Sequence[Any],\r
68                   kwargs: Mapping[str, Any]) -> Any:\r
69         raise IndexError()\r
70         raise KeyError()\r
71     def check_unused_args(self, used_args: Sequence[Union[int, str]], args: Sequence[Any],\r
72                           kwargs: Mapping[str, Any]) -> None: ...\r
73     def format_field(self, value: Any, format_spec: str) -> Any: ...\r
74     def convert_field(self, value: Any, conversion: str) -> Any: ...\r