Skip to content

Commit ae9251c

Browse files
committed
ENH: Move complex type to _typing
1 parent 57bd9b8 commit ae9251c

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

pandas-stubs/_typing.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,5 +243,7 @@ CSVEngine = Literal["c", "python", "pyarrow", "python-fwf"]
243243

244244
HDFCompLib = Literal["zlib", "lzo", "bzip2", "blosc"]
245245
ParquetEngine = Literal["auto", "pyarrow", "fastparquet"]
246-
246+
FileWriteMode = Literal[
247+
"a", "w", "x", "at", "wt", "xt", "ab", "wb", "xb", "w+", "w+b", "a+", "a+b"
248+
]
247249
__all__ = ["npt", "type_t"]

pandas-stubs/core/generic.pyi

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ from pandas._typing import (
2222
Dtype,
2323
FilePath,
2424
FilePathOrBuffer,
25+
FileWriteMode,
2526
FillnaOptions,
2627
FrameOrSeries,
2728
FrameOrSeriesUnion,
@@ -213,9 +214,7 @@ class NDFrame(PandasObject, indexing.IndexingMixin):
213214
header: _bool | list[_str] = ...,
214215
index: _bool = ...,
215216
index_label: Literal[False] | _str | list[HashableT] | None = ...,
216-
mode: Literal[
217-
"a", "w", "x", "at", "wt", "xt", "ab", "wb", "xb", "w+", "w+b", "a+", "a+b"
218-
] = ...,
217+
mode: FileWriteMode = ...,
219218
encoding: _str | None = ...,
220219
compression: CompressionOptions = ...,
221220
quoting: int | None = ...,
@@ -240,9 +239,7 @@ class NDFrame(PandasObject, indexing.IndexingMixin):
240239
header: _bool | list[_str] = ...,
241240
index: _bool = ...,
242241
index_label: Literal[False] | _str | list[HashableT] | None = ...,
243-
mode: Literal[
244-
"a", "w", "x", "at", "wt", "xt", "ab", "wb", "xb", "w+", "w+b", "a+", "a+b"
245-
] = ...,
242+
mode: FileWriteMode = ...,
246243
encoding: _str | None = ...,
247244
compression: CompressionOptions = ...,
248245
quoting: int | None = ...,

0 commit comments

Comments
 (0)