Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix type hints and enable mypy #486

Merged
merged 2 commits into from
Nov 12, 2023
Merged

Conversation

KapJI
Copy link
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.

voluptuous/error.py Outdated Show resolved Hide resolved
@alecthomas alecthomas merged commit 5599057 into alecthomas:master Nov 12, 2023
6 checks passed
@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