Skip to content

Commit

Permalink
Merge pull request #708 from rouge8/converter-no-anystr
Browse files Browse the repository at this point in the history
Fix the type hint for `Field.converter`
  • Loading branch information
glyph committed Mar 11, 2024
2 parents bad4cf3 + df757be commit 0f3597e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/klein/_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class Field:
@ivar converter: The converter.
"""

converter: Callable[[AnyStr], Any]
converter: Callable[[str], Any]
formInputType: str
pythonArgumentName: Optional[str] = None
formFieldName: Optional[str] = None
Expand Down Expand Up @@ -267,7 +267,7 @@ def number(
An integer within the range [minimum, maximum].
"""

def bounded_number(text: AnyStr) -> Any:
def bounded_number(text: str) -> Any:
try:
value = kind(text)
except (ValueError, ArithmeticError):
Expand Down

0 comments on commit 0f3597e

Please sign in to comment.