diff --git a/pandas/io/formats/csvs.py b/pandas/io/formats/csvs.py index e9af2f6676092..f078975e4b85a 100644 --- a/pandas/io/formats/csvs.py +++ b/pandas/io/formats/csvs.py @@ -9,7 +9,6 @@ from typing import ( TYPE_CHECKING, Any, - AnyStr, Hashable, Iterator, Sequence, @@ -49,7 +48,7 @@ class CSVFormatter: def __init__( self, formatter: DataFrameFormatter, - path_or_buf: FilePathOrBuffer[AnyStr] = "", + path_or_buf: FilePathOrBuffer[str] | FilePathOrBuffer[bytes] = "", sep: str = ",", cols: Sequence[Hashable] | None = None, index_label: IndexLabel | None = None,