Skip to content

Commit ae6f7fd

Browse files
author
Kevin Sheppard
committed
MAINT: Merge master
2 parents 3863698 + 15d2775 commit ae6f7fd

File tree

6 files changed

+318
-166
lines changed

6 files changed

+318
-166
lines changed

pandas-stubs/_typing.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ PythonScalar = Union[str, bool, complex]
4848
DatetimeLikeScalar = TypeVar("DatetimeLikeScalar", Period, Timestamp, Timedelta)
4949
PandasScalar = Union[bytes, datetime.date, datetime.datetime, datetime.timedelta]
5050
# Scalar = Union[PythonScalar, PandasScalar]
51-
IntStrT = TypeVar("IntStrT", int, str)
5251

5352
DatetimeLike = Union[datetime.date, datetime.datetime, np.datetime64, Timestamp]
5453

@@ -74,6 +73,9 @@ class ReadCsvBuffer(ReadBuffer[AnyStr_cov], Protocol[AnyStr_cov]):
7473
@property
7574
def closed(self) -> bool: ...
7675

76+
class WriteExcelBuffer(WriteBuffer[bytes], Protocol):
77+
def truncate(self, size: Union[int, None] = ...) -> int: ...
78+
7779
FilePath = Union[str, PathLike[str]]
7880

7981
Buffer = Union[IO[AnyStr], RawIOBase, BufferedIOBase, TextIOBase, TextIOWrapper, mmap]

pandas-stubs/io/common.pyi

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,21 @@ class IOHandles(Generic[AnyStr]):
1515
def __enter__(self) -> IOHandles[AnyStr]: ...
1616
def __exit__(self, *args: object) -> None: ...
1717
def __init__(self, handle, compression, created_handles, is_wrapped) -> None: ...
18+
19+
from typing import (
20+
IO,
21+
AnyStr,
22+
Generic,
23+
)
24+
25+
from pandas._typing import CompressionDict
26+
27+
class IOHandles(Generic[AnyStr]):
28+
handle: IO[AnyStr]
29+
compression: CompressionDict
30+
created_handles: list[IO[AnyStr]]
31+
is_wrapped: bool
32+
def close(self) -> None: ...
33+
def __enter__(self) -> IOHandles[AnyStr]: ...
34+
def __exit__(self, *args: object) -> None: ...
35+
def __init__(self, handle, compression, created_handles, is_wrapped) -> None: ...

0 commit comments

Comments
 (0)