massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stdlib / _csv.pyi
1 from typing import Any, Iterable, Iterator, List, Protocol, Type, Union
2
3 QUOTE_ALL: int
4 QUOTE_MINIMAL: int
5 QUOTE_NONE: int
6 QUOTE_NONNUMERIC: int
7
8 class Error(Exception): ...
9
10 class Dialect:
11     delimiter: str
12     quotechar: str | None
13     escapechar: str | None
14     doublequote: bool
15     skipinitialspace: bool
16     lineterminator: str
17     quoting: int
18     strict: int
19     def __init__(self) -> None: ...
20
21 _DialectLike = Union[str, Dialect, Type[Dialect]]
22
23 class _reader(Iterator[List[str]]):
24     dialect: Dialect
25     line_num: int
26     def __next__(self) -> list[str]: ...
27
28 class _writer:
29     dialect: Dialect
30     def writerow(self, row: Iterable[Any]) -> Any: ...
31     def writerows(self, rows: Iterable[Iterable[Any]]) -> None: ...
32
33 class _Writer(Protocol):
34     def write(self, s: str, /) -> Any: ...
35
36 def writer(csvfile: _Writer, dialect: _DialectLike = ..., **fmtparams: Any) -> _writer: ...
37 def reader(csvfile: Iterable[str], dialect: _DialectLike = ..., **fmtparams: Any) -> _reader: ...
38 def register_dialect(name: str, dialect: Any = ..., **fmtparams: Any) -> None: ...
39 def unregister_dialect(name: str) -> None: ...
40 def get_dialect(name: str) -> Dialect: ...
41 def list_dialects() -> list[str]: ...
42 def field_size_limit(new_limit: int = ...) -> int: ...