massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stdlib / string.pyi
1 import sys
2 from re import RegexFlag
3 from typing import Any, Iterable, Mapping, Sequence
4
5 if sys.version_info >= (3, 8):
6     from re import Pattern
7 else:
8     from typing import Pattern
9
10 ascii_letters: str
11 ascii_lowercase: str
12 ascii_uppercase: str
13 digits: str
14 hexdigits: str
15 octdigits: str
16 punctuation: str
17 printable: str
18 whitespace: str
19
20 def capwords(s: str, sep: str | None = ...) -> str: ...
21
22 class Template:
23     template: str
24     delimiter: str
25     idpattern: str
26     braceidpattern: str | None
27     flags: RegexFlag
28     pattern: Pattern[str]
29     def __init__(self, template: str) -> None: ...
30     def substitute(self, __mapping: Mapping[str, object] = ..., **kwds: object) -> str: ...
31     def safe_substitute(self, __mapping: Mapping[str, object] = ..., **kwds: object) -> str: ...
32
33 # TODO(MichalPokorny): This is probably badly and/or loosely typed.
34 class Formatter:
35     def format(self, __format_string: str, *args: Any, **kwargs: Any) -> str: ...
36     def vformat(self, format_string: str, args: Sequence[Any], kwargs: Mapping[str, Any]) -> str: ...
37     def parse(self, format_string: str) -> Iterable[tuple[str, str | None, str | None, str | None]]: ...
38     def get_field(self, field_name: str, args: Sequence[Any], kwargs: Mapping[str, Any]) -> Any: ...
39     def get_value(self, key: int | str, args: Sequence[Any], kwargs: Mapping[str, Any]) -> Any: ...
40     def check_unused_args(self, used_args: Sequence[int | str], args: Sequence[Any], kwargs: Mapping[str, Any]) -> None: ...
41     def format_field(self, value: Any, format_spec: str) -> Any: ...
42     def convert_field(self, value: Any, conversion: str) -> Any: ...