Skip to content

Commit c407a44

Browse files
authored
Add defaults to csv stubs (#9774)
1 parent 5ac8078 commit c407a44

2 files changed

Lines changed: 51 additions & 51 deletions

File tree

stdlib/_csv.pyi

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -43,42 +43,42 @@ class _writer:
4343

4444
def writer(
4545
csvfile: SupportsWrite[str],
46-
dialect: _DialectLike = ...,
46+
dialect: _DialectLike = "excel",
4747
*,
48-
delimiter: str = ...,
49-
quotechar: str | None = ...,
50-
escapechar: str | None = ...,
51-
doublequote: bool = ...,
52-
skipinitialspace: bool = ...,
53-
lineterminator: str = ...,
54-
quoting: _QuotingType = ...,
55-
strict: bool = ...,
48+
delimiter: str = ",",
49+
quotechar: str | None = '"',
50+
escapechar: str | None = None,
51+
doublequote: bool = True,
52+
skipinitialspace: bool = False,
53+
lineterminator: str = "\r\n",
54+
quoting: _QuotingType = 0,
55+
strict: bool = False,
5656
) -> _writer: ...
5757
def reader(
5858
csvfile: Iterable[str],
59-
dialect: _DialectLike = ...,
59+
dialect: _DialectLike = "excel",
6060
*,
61-
delimiter: str = ...,
62-
quotechar: str | None = ...,
63-
escapechar: str | None = ...,
64-
doublequote: bool = ...,
65-
skipinitialspace: bool = ...,
66-
lineterminator: str = ...,
67-
quoting: _QuotingType = ...,
68-
strict: bool = ...,
61+
delimiter: str = ",",
62+
quotechar: str | None = '"',
63+
escapechar: str | None = None,
64+
doublequote: bool = True,
65+
skipinitialspace: bool = False,
66+
lineterminator: str = "\r\n",
67+
quoting: _QuotingType = 0,
68+
strict: bool = False,
6969
) -> _reader: ...
7070
def register_dialect(
7171
name: str,
72-
dialect: Any = ...,
72+
dialect: type[Dialect] = ...,
7373
*,
74-
delimiter: str = ...,
75-
quotechar: str | None = ...,
76-
escapechar: str | None = ...,
77-
doublequote: bool = ...,
78-
skipinitialspace: bool = ...,
79-
lineterminator: str = ...,
80-
quoting: _QuotingType = ...,
81-
strict: bool = ...,
74+
delimiter: str = ",",
75+
quotechar: str | None = '"',
76+
escapechar: str | None = None,
77+
doublequote: bool = True,
78+
skipinitialspace: bool = False,
79+
lineterminator: str = "\r\n",
80+
quoting: _QuotingType = 0,
81+
strict: bool = False,
8282
) -> None: ...
8383
def unregister_dialect(name: str) -> None: ...
8484
def get_dialect(name: str) -> Dialect: ...

stdlib/csv.pyi

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,14 @@ class DictReader(Generic[_T], Iterator[_DictReadMapping[_T | Any, str | Any]]):
8080
restval: str | None = None,
8181
dialect: _DialectLike = "excel",
8282
*,
83-
delimiter: str = ...,
84-
quotechar: str | None = ...,
85-
escapechar: str | None = ...,
86-
doublequote: bool = ...,
87-
skipinitialspace: bool = ...,
88-
lineterminator: str = ...,
89-
quoting: _QuotingType = ...,
90-
strict: bool = ...,
83+
delimiter: str = ",",
84+
quotechar: str | None = '"',
85+
escapechar: str | None = None,
86+
doublequote: bool = True,
87+
skipinitialspace: bool = False,
88+
lineterminator: str = "\r\n",
89+
quoting: _QuotingType = 0,
90+
strict: bool = False,
9191
) -> None: ...
9292
@overload
9393
def __init__(
@@ -98,14 +98,14 @@ class DictReader(Generic[_T], Iterator[_DictReadMapping[_T | Any, str | Any]]):
9898
restval: str | None = None,
9999
dialect: _DialectLike = "excel",
100100
*,
101-
delimiter: str = ...,
102-
quotechar: str | None = ...,
103-
escapechar: str | None = ...,
104-
doublequote: bool = ...,
105-
skipinitialspace: bool = ...,
106-
lineterminator: str = ...,
107-
quoting: _QuotingType = ...,
108-
strict: bool = ...,
101+
delimiter: str = ",",
102+
quotechar: str | None = '"',
103+
escapechar: str | None = None,
104+
doublequote: bool = True,
105+
skipinitialspace: bool = False,
106+
lineterminator: str = "\r\n",
107+
quoting: _QuotingType = 0,
108+
strict: bool = False,
109109
) -> None: ...
110110
def __iter__(self) -> Self: ...
111111
def __next__(self) -> _DictReadMapping[_T | Any, str | Any]: ...
@@ -125,14 +125,14 @@ class DictWriter(Generic[_T]):
125125
extrasaction: Literal["raise", "ignore"] = "raise",
126126
dialect: _DialectLike = "excel",
127127
*,
128-
delimiter: str = ...,
129-
quotechar: str | None = ...,
130-
escapechar: str | None = ...,
131-
doublequote: bool = ...,
132-
skipinitialspace: bool = ...,
133-
lineterminator: str = ...,
134-
quoting: _QuotingType = ...,
135-
strict: bool = ...,
128+
delimiter: str = ",",
129+
quotechar: str | None = '"',
130+
escapechar: str | None = None,
131+
doublequote: bool = True,
132+
skipinitialspace: bool = False,
133+
lineterminator: str = "\r\n",
134+
quoting: _QuotingType = 0,
135+
strict: bool = False,
136136
) -> None: ...
137137
if sys.version_info >= (3, 8):
138138
def writeheader(self) -> Any: ...

0 commit comments

Comments
 (0)