Skip to content

Fix type hints and enable mypy#486

Merged
alecthomas merged 2 commits intoalecthomas:masterfrom
KapJI:fix-type-hints
Nov 12, 2023
Merged

Fix type hints and enable mypy#486
alecthomas merged 2 commits intoalecthomas:masterfrom
KapJI:fix-type-hints

Conversation

@KapJI
Copy link
Copy Markdown
Contributor

@KapJI KapJI commented Nov 11, 2023

Type hints are not very useful if they are not checked.

  • Breaking change: Invalid.path and Invalid.error_message are no longer writable (properties). Because they are propertis in subclass MultipleInvalid and subclass can't override writable as read only.
  • Fix definition of Schemable. Extra is not a type but Callable and Callable is already there. For NoneType just None should be used.
  • Add mypy to run with tox.
  • Fix flake8 warnings regarding using isinstance instead of direct comparison.

Comment thread voluptuous/error.py Outdated
@alecthomas alecthomas merged commit 5599057 into alecthomas:master Nov 12, 2023
@KapJI KapJI deleted the fix-type-hints branch November 12, 2023 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants