Skip to content

Commit

Permalink
Typing fix in FileHistory.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanslenders committed May 15, 2024
1 parent 3c0290d commit 491b5e8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/prompt_toolkit/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import threading
from abc import ABCMeta, abstractmethod
from asyncio import get_running_loop
from typing import AsyncGenerator, Iterable, Sequence
from typing import AsyncGenerator, Iterable, Sequence, Union

__all__ = [
"History",
Expand Down Expand Up @@ -255,12 +255,15 @@ def append_string(self, string: str) -> None:
pass


_StrOrBytesPath = Union[str, bytes, "os.PathLike[str]", "os.PathLike[bytes]"]


class FileHistory(History):
"""
:class:`.History` class that stores all strings in a file.
"""

def __init__(self, filename: str | os.PathLike) -> None:
def __init__(self, filename: _StrOrBytesPath) -> None:
self.filename = filename
super().__init__()

Expand Down

0 comments on commit 491b5e8

Please sign in to comment.