mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 12:14:27 +08:00
csv: more precise types, remove TODO (#3581)
This commit is contained in:
committed by
Jelle Zijlstra
parent
1efc1baaf7
commit
b7a611e211
@@ -1,6 +1,6 @@
|
||||
import sys
|
||||
|
||||
from typing import Any, Iterable, Iterator, List, Optional, Sequence, Text
|
||||
from typing import Any, Iterable, Iterator, List, Optional, Protocol, Sequence, Text, Union
|
||||
|
||||
QUOTE_ALL: int
|
||||
QUOTE_MINIMAL: int
|
||||
@@ -39,9 +39,10 @@ class _writer:
|
||||
def writerows(self, rows: Iterable[Sequence[Any]]) -> None: ...
|
||||
|
||||
|
||||
# TODO: precise type
|
||||
def writer(csvfile: Any, dialect: Any = ..., **fmtparams: Any) -> _writer: ...
|
||||
def reader(csvfile: Iterable[Text], dialect: Any = ..., **fmtparams: Any) -> _reader: ...
|
||||
class _Writer(Protocol):
|
||||
def write(self, s: str) -> Any: ...
|
||||
def writer(csvfile: _Writer, dialect: Union[Dialect, str] = ..., **fmtparams: Any) -> _writer: ...
|
||||
def reader(csvfile: Iterable[Text], dialect: Union[Dialect, str] = ..., **fmtparams: Any) -> _reader: ...
|
||||
def register_dialect(name: str, dialect: Any = ..., **fmtparams: Any) -> None: ...
|
||||
def unregister_dialect(name: str) -> None: ...
|
||||
def get_dialect(name: str) -> Dialect: ...
|
||||
|
||||
Reference in New Issue
Block a user