mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 21:14:48 +08:00
csv: Make _Writer.write positional-only (#6475)
At runtime it only uses positional parameters. I think this works fortuitously in mypy and pyright because mypy ignores parameter names in protocols and pyright has a bug that allows passing positional-only to pos-or-keyword params (microsoft/pyright#2652) and the parameter to `io.TextIO.write` happens to be `__s`.
This commit is contained in:
@@ -34,7 +34,7 @@ class _writer:
|
||||
def writerows(self, rows: Iterable[Iterable[Any]]) -> None: ...
|
||||
|
||||
class _Writer(Protocol):
|
||||
def write(self, s: str) -> Any: ...
|
||||
def write(self, __s: str) -> object: ...
|
||||
|
||||
def writer(csvfile: _Writer, dialect: _DialectLike = ..., **fmtparams: Any) -> _writer: ...
|
||||
def reader(csvfile: Iterable[str], dialect: _DialectLike = ..., **fmtparams: Any) -> _reader: ...
|
||||
|
||||
Reference in New Issue
Block a user