Skip to content

Commit c8ffd8b

Browse files
committed
Removed Matchable type since it's only used one place.
1 parent 7f38e85 commit c8ffd8b

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

cmd2/cmd2.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@
153153
CmdOrSet,
154154
CompleterBound,
155155
CompleterUnbound,
156-
Matchable,
157156
)
158157

159158
with contextlib.suppress(ImportError):
@@ -1823,7 +1822,7 @@ def basic_complete(
18231822
line: str, # noqa: ARG002
18241823
begidx: int, # noqa: ARG002
18251824
endidx: int, # noqa: ARG002
1826-
match_against: Iterable[Matchable],
1825+
match_against: Iterable[str | CompletionItem],
18271826
*,
18281827
sort: bool = True,
18291828
) -> Completions:

cmd2/types.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
if TYPE_CHECKING: # pragma: no cover
1616
from .cmd2 import Cmd
1717
from .command_definition import CommandSet
18-
from .completion import Choices, CompletionItem, Completions
18+
from .completion import Choices, Completions
1919

2020
# A Cmd or CommandSet
2121
CmdOrSet = TypeVar("CmdOrSet", bound=Union["Cmd", "CommandSet"])
@@ -27,11 +27,6 @@
2727
# Represents the parsed tokens from argparse during completion
2828
ArgTokens: TypeAlias = Mapping[str, Sequence[str]]
2929

30-
# Represents a type that can be matched against when completing.
31-
# Strings are matched directly while CompletionItems are matched
32-
# against their 'text' member.
33-
Matchable: TypeAlias = Union[str, "CompletionItem"]
34-
3530
##################################################
3631
# choices_provider function types
3732
##################################################

0 commit comments

Comments
 (0)