From e81d17e3b21ebe34b52f7e4353347bfcda4b0836 Mon Sep 17 00:00:00 2001 From: Max R Date: Sun, 16 Jun 2024 20:32:08 +0200 Subject: [PATCH 1/2] Update fuzzy_completer.py --- src/prompt_toolkit/completion/fuzzy_completer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/prompt_toolkit/completion/fuzzy_completer.py b/src/prompt_toolkit/completion/fuzzy_completer.py index 25ea8923a..82625ab63 100644 --- a/src/prompt_toolkit/completion/fuzzy_completer.py +++ b/src/prompt_toolkit/completion/fuzzy_completer.py @@ -1,7 +1,7 @@ from __future__ import annotations import re -from typing import Callable, Iterable, NamedTuple +from typing import Callable, Iterable, NamedTuple, Sequence from prompt_toolkit.document import Document from prompt_toolkit.filters import FilterOrBool, to_filter @@ -187,7 +187,7 @@ class FuzzyWordCompleter(Completer): def __init__( self, - words: list[str] | Callable[[], list[str]], + words: Sequence[str] | Callable[[], Sequence[str]], meta_dict: dict[str, str] | None = None, WORD: bool = False, ) -> None: From 97ddcf30f2ac4299ee8e941dfdc4b91af1fcca2d Mon Sep 17 00:00:00 2001 From: Max R Date: Sun, 16 Jun 2024 20:32:46 +0200 Subject: [PATCH 2/2] Update word_completer.py --- src/prompt_toolkit/completion/word_completer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/prompt_toolkit/completion/word_completer.py b/src/prompt_toolkit/completion/word_completer.py index 6ef4031fa..2e124056b 100644 --- a/src/prompt_toolkit/completion/word_completer.py +++ b/src/prompt_toolkit/completion/word_completer.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import Callable, Iterable, Mapping, Pattern +from typing import Callable, Iterable, Mapping, Pattern, Sequence from prompt_toolkit.completion import CompleteEvent, Completer, Completion from prompt_toolkit.document import Document @@ -33,7 +33,7 @@ class WordCompleter(Completer): def __init__( self, - words: list[str] | Callable[[], list[str]], + words: Sequence[str] | Callable[[], Sequence[str]], ignore_case: bool = False, display_dict: Mapping[str, AnyFormattedText] | None = None, meta_dict: Mapping[str, AnyFormattedText] | None = None,