diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 751e7911d7130..0960ab4a81149 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -1069,7 +1069,7 @@ def to_string( @overload def to_string( self, - buf: FilePathOrBuffer[str], + buf: FilePath | WriteBuffer[str], columns: Sequence[str] | None = ..., col_space: int | list[int] | dict[Hashable, int] | None = ..., header: bool | Sequence[str] = ...,