@@ -8,6 +8,7 @@ from typing import (
8
8
Any ,
9
9
Callable ,
10
10
Literal ,
11
+ Mapping ,
11
12
Sequence ,
12
13
overload ,
13
14
)
@@ -48,23 +49,26 @@ def read_csv(
48
49
| None = ...,
49
50
dtype : DtypeArg | defaultdict | None = ...,
50
51
engine : CSVEngine | None = ...,
51
- converters : dict [int | str , Callable [[str ], Any ]] | None = ...,
52
+ converters : Mapping [int | str , Callable [[str ], Any ]]
53
+ | Mapping [int , Callable [[str ], Any ]]
54
+ | Mapping [str , Callable [[str ], Any ]]
55
+ | None = ...,
52
56
true_values : list [str ] = ...,
53
57
false_values : list [str ] = ...,
54
58
skipinitialspace : bool = ...,
55
59
skiprows : int | Sequence [int ] | Callable [[int ], bool ] = ...,
56
60
skipfooter : int = ...,
57
61
nrows : int | None = ...,
58
- na_values : Sequence [str ] | dict [str , Sequence [str ]] = ...,
62
+ na_values : Sequence [str ] | Mapping [str , Sequence [str ]] = ...,
59
63
keep_default_na : bool = ...,
60
64
na_filter : bool = ...,
61
65
verbose : bool = ...,
62
66
skip_blank_lines : bool = ...,
63
67
parse_dates : bool
64
- | Sequence [int ]
68
+ | list [int ]
65
69
| list [str ]
66
70
| Sequence [Sequence [int ]]
67
- | dict [str , Sequence [int ]] = ...,
71
+ | Mapping [str , Sequence [int | str ]] = ...,
68
72
infer_datetime_format : bool = ...,
69
73
keep_date_col : bool = ...,
70
74
date_parser : Callable = ...,
@@ -111,23 +115,26 @@ def read_csv(
111
115
| None = ...,
112
116
dtype : DtypeArg | defaultdict | None = ...,
113
117
engine : CSVEngine | None = ...,
114
- converters : dict [int | str , Callable [[str ], Any ]] | None = ...,
118
+ converters : Mapping [int | str , Callable [[str ], Any ]]
119
+ | Mapping [int , Callable [[str ], Any ]]
120
+ | Mapping [str , Callable [[str ], Any ]]
121
+ | None = ...,
115
122
true_values : list [str ] = ...,
116
123
false_values : list [str ] = ...,
117
124
skipinitialspace : bool = ...,
118
125
skiprows : int | Sequence [int ] | Callable [[int ], bool ] = ...,
119
126
skipfooter : int = ...,
120
127
nrows : int | None = ...,
121
- na_values : Sequence [str ] | dict [str , Sequence [str ]] = ...,
128
+ na_values : Sequence [str ] | Mapping [str , Sequence [str ]] = ...,
122
129
keep_default_na : bool = ...,
123
130
na_filter : bool = ...,
124
131
verbose : bool = ...,
125
132
skip_blank_lines : bool = ...,
126
133
parse_dates : bool
127
- | Sequence [int ]
134
+ | list [int ]
128
135
| list [str ]
129
136
| Sequence [Sequence [int ]]
130
- | dict [str , Sequence [int ]] = ...,
137
+ | Mapping [str , Sequence [int | str ]] = ...,
131
138
infer_datetime_format : bool = ...,
132
139
keep_date_col : bool = ...,
133
140
date_parser : Callable = ...,
@@ -174,23 +181,26 @@ def read_csv(
174
181
| None = ...,
175
182
dtype : DtypeArg | defaultdict | None = ...,
176
183
engine : CSVEngine | None = ...,
177
- converters : dict [int | str , Callable [[str ], Any ]] | None = ...,
184
+ converters : Mapping [int | str , Callable [[str ], Any ]]
185
+ | Mapping [int , Callable [[str ], Any ]]
186
+ | Mapping [str , Callable [[str ], Any ]]
187
+ | None = ...,
178
188
true_values : list [str ] = ...,
179
189
false_values : list [str ] = ...,
180
190
skipinitialspace : bool = ...,
181
191
skiprows : int | Sequence [int ] | Callable [[int ], bool ] = ...,
182
192
skipfooter : int = ...,
183
193
nrows : int | None = ...,
184
- na_values : Sequence [str ] | dict [str , Sequence [str ]] = ...,
194
+ na_values : Sequence [str ] | Mapping [str , Sequence [str ]] = ...,
185
195
keep_default_na : bool = ...,
186
196
na_filter : bool = ...,
187
197
verbose : bool = ...,
188
198
skip_blank_lines : bool = ...,
189
199
parse_dates : bool
190
- | Sequence [int ]
200
+ | list [int ]
191
201
| list [str ]
192
202
| Sequence [Sequence [int ]]
193
- | dict [str , Sequence [int ]] = ...,
203
+ | Mapping [str , Sequence [int | str ]] = ...,
194
204
infer_datetime_format : bool = ...,
195
205
keep_date_col : bool = ...,
196
206
date_parser : Callable = ...,
@@ -237,23 +247,26 @@ def read_table(
237
247
| None = ...,
238
248
dtype : DtypeArg | defaultdict | None = ...,
239
249
engine : CSVEngine | None = ...,
240
- converters : dict [int | str , Callable [[str ], Any ]] | None = ...,
250
+ converters : Mapping [int | str , Callable [[str ], Any ]]
251
+ | Mapping [int , Callable [[str ], Any ]]
252
+ | Mapping [str , Callable [[str ], Any ]]
253
+ | None = ...,
241
254
true_values : list [str ] = ...,
242
255
false_values : list [str ] = ...,
243
256
skipinitialspace : bool = ...,
244
257
skiprows : int | Sequence [int ] | Callable [[int ], bool ] = ...,
245
258
skipfooter : int = ...,
246
259
nrows : int | None = ...,
247
- na_values : Sequence [str ] | dict [str , Sequence [str ]] = ...,
260
+ na_values : Sequence [str ] | Mapping [str , Sequence [str ]] = ...,
248
261
keep_default_na : bool = ...,
249
262
na_filter : bool = ...,
250
263
verbose : bool = ...,
251
264
skip_blank_lines : bool = ...,
252
265
parse_dates : bool
253
- | Sequence [int ]
266
+ | list [int ]
254
267
| list [str ]
255
268
| Sequence [Sequence [int ]]
256
- | dict [str , Sequence [int ]] = ...,
269
+ | Mapping [str , Sequence [int | str ]] = ...,
257
270
infer_datetime_format : bool = ...,
258
271
keep_date_col : bool = ...,
259
272
date_parser : Callable = ...,
@@ -300,23 +313,26 @@ def read_table(
300
313
| None = ...,
301
314
dtype : DtypeArg | defaultdict | None = ...,
302
315
engine : CSVEngine | None = ...,
303
- converters : dict [int | str , Callable [[str ], Any ]] | None = ...,
316
+ converters : Mapping [int | str , Callable [[str ], Any ]]
317
+ | Mapping [int , Callable [[str ], Any ]]
318
+ | Mapping [str , Callable [[str ], Any ]]
319
+ | None = ...,
304
320
true_values : list [str ] = ...,
305
321
false_values : list [str ] = ...,
306
322
skipinitialspace : bool = ...,
307
323
skiprows : int | Sequence [int ] | Callable [[int ], bool ] = ...,
308
324
skipfooter : int = ...,
309
325
nrows : int | None = ...,
310
- na_values : Sequence [str ] | dict [str , Sequence [str ]] = ...,
326
+ na_values : Sequence [str ] | Mapping [str , Sequence [str ]] = ...,
311
327
keep_default_na : bool = ...,
312
328
na_filter : bool = ...,
313
329
verbose : bool = ...,
314
330
skip_blank_lines : bool = ...,
315
331
parse_dates : bool
316
- | Sequence [int ]
332
+ | list [int ]
317
333
| list [str ]
318
334
| Sequence [Sequence [int ]]
319
- | dict [str , Sequence [int ]] = ...,
335
+ | Mapping [str , Sequence [int | str ]] = ...,
320
336
infer_datetime_format : bool = ...,
321
337
keep_date_col : bool = ...,
322
338
date_parser : Callable = ...,
@@ -363,23 +379,26 @@ def read_table(
363
379
| None = ...,
364
380
dtype : DtypeArg | defaultdict | None = ...,
365
381
engine : CSVEngine | None = ...,
366
- converters : dict [int | str , Callable [[str ], Any ]] | None = ...,
382
+ converters : Mapping [int | str , Callable [[str ], Any ]]
383
+ | Mapping [int , Callable [[str ], Any ]]
384
+ | Mapping [str , Callable [[str ], Any ]]
385
+ | None = ...,
367
386
true_values : list [str ] = ...,
368
387
false_values : list [str ] = ...,
369
388
skipinitialspace : bool = ...,
370
389
skiprows : int | Sequence [int ] | Callable [[int ], bool ] = ...,
371
390
skipfooter : int = ...,
372
391
nrows : int | None = ...,
373
- na_values : Sequence [str ] | dict [str , Sequence [str ]] = ...,
392
+ na_values : Sequence [str ] | Mapping [str , Sequence [str ]] = ...,
374
393
keep_default_na : bool = ...,
375
394
na_filter : bool = ...,
376
395
verbose : bool = ...,
377
396
skip_blank_lines : bool = ...,
378
397
parse_dates : bool
379
- | Sequence [int ]
398
+ | list [int ]
380
399
| list [str ]
381
400
| Sequence [Sequence [int ]]
382
- | dict [str , Sequence [int ]] = ...,
401
+ | Mapping [str , Sequence [int | str ]] = ...,
383
402
infer_datetime_format : bool = ...,
384
403
keep_date_col : bool = ...,
385
404
date_parser : Callable = ...,
@@ -443,7 +462,7 @@ def read_fwf(
443
462
444
463
class TextFileReader (abc .Iterator ):
445
464
engine : CSVEngine
446
- orig_options : dict [str , Any ]
465
+ orig_options : Mapping [str , Any ]
447
466
chunksize : int | None
448
467
nrows : int | None
449
468
squeeze : bool
0 commit comments