Skip to content

Commit

Permalink
Remove ReturnMatcher alias
Browse files Browse the repository at this point in the history
As pointed out by @tlambert03, we can just use the single TypeMatcher
alias
  • Loading branch information
gselzer committed Jan 24, 2022
1 parent 21dfec4 commit 7def48e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions magicgui/type_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
from magicgui.types import (
PathLike,
ReturnCallback,
ReturnMatcher,
TypeMatcher,
WidgetClass,
WidgetOptions,
Expand All @@ -44,7 +43,7 @@ class MissingWidget(RuntimeError):


_RETURN_CALLBACKS: DefaultDict[type, list[ReturnCallback]] = defaultdict(list)
_RETURN_MATCHERS: list[ReturnMatcher] = list()
_RETURN_MATCHERS: list[TypeMatcher] = list()
_TYPE_MATCHERS: list[TypeMatcher] = list()
_TYPE_DEFS: dict[type, WidgetTuple] = dict()

Expand Down Expand Up @@ -114,12 +113,12 @@ def type_matcher(func: TypeMatcher) -> TypeMatcher:
return func


def return_matcher(func: ReturnMatcher) -> ReturnMatcher:
def return_matcher(func: TypeMatcher) -> TypeMatcher:
"""Add function to the set of return matchers.

Example
-------
>>> @return
>>> @return_matcher
... def default_return_widget(value, annotation):
... return widgets.LineEdit, {}
"""
Expand Down

0 comments on commit 7def48e

Please sign in to comment.