We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3c0290d commit 491b5e8Copy full SHA for 491b5e8
src/prompt_toolkit/history.py
@@ -15,7 +15,7 @@
15
import threading
16
from abc import ABCMeta, abstractmethod
17
from asyncio import get_running_loop
18
-from typing import AsyncGenerator, Iterable, Sequence
+from typing import AsyncGenerator, Iterable, Sequence, Union
19
20
__all__ = [
21
"History",
@@ -255,12 +255,15 @@ def append_string(self, string: str) -> None:
255
pass
256
257
258
+_StrOrBytesPath = Union[str, bytes, "os.PathLike[str]", "os.PathLike[bytes]"]
259
+
260
261
class FileHistory(History):
262
"""
263
:class:`.History` class that stores all strings in a file.
264
265
- def __init__(self, filename: str | os.PathLike) -> None:
266
+ def __init__(self, filename: _StrOrBytesPath) -> None:
267
self.filename = filename
268
super().__init__()
269
0 commit comments