Skip to content

Commit 4d4f0ac

Browse files
committed
Some more type sigs
1 parent f278454 commit 4d4f0ac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/parsy/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ def test_item_parser(stream, index):
455455
return test_item_parser
456456

457457

458-
def test_char(func, description):
458+
def test_char(func: Callable[[str], bool], description: str) -> Parser[str]:
459459
# Implementation is identical to test_item
460460
return test_item(func, description)
461461

@@ -513,7 +513,7 @@ def eof(stream: str, index: int) -> Result[None]:
513513
E = TypeVar("E", bound=enum.Enum)
514514

515515

516-
def from_enum(enum_cls: type[E], transform: Callable = noop) -> Parser[E]:
516+
def from_enum(enum_cls: type[E], transform: Callable[[str], str] = noop) -> Parser[E]:
517517
items = sorted(
518518
((str(enum_item.value), enum_item) for enum_item in enum_cls), key=lambda t: len(t[0]), reverse=True
519519
)

0 commit comments

Comments
 (0)