-
Notifications
You must be signed in to change notification settings - Fork 2
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
Support for mypy #116
Labels
enhancement
Improvements to existing features or smaller new features
refactoring
Code refactoring, clean up and other code maintenance work.
testing
Related to testing (e.g. unit tests)
Milestone
Comments
binaryDiv
added a commit
that referenced
this issue
Apr 30, 2024
binaryDiv
added a commit
that referenced
this issue
Apr 30, 2024
binaryDiv
added a commit
that referenced
this issue
Apr 30, 2024
binaryDiv
added a commit
that referenced
this issue
Apr 30, 2024
binaryDiv
added a commit
that referenced
this issue
Apr 30, 2024
binaryDiv
added a commit
that referenced
this issue
Apr 30, 2024
This isn't really a fix since we're just ignoring the line, however, in this case we can make a safe assumption that the typing is correct.
binaryDiv
added a commit
that referenced
this issue
Apr 30, 2024
…ators According to OOP principles, overriding the return type of validate() in a subclass in an incompatible way (e.g. date is not a subclass of str) is not allowed. However, with our validators it absolutely makes sense to use base validators and convert their output to different types (e.g. string to date).
binaryDiv
added a commit
that referenced
this issue
Apr 30, 2024
binaryDiv
added a commit
that referenced
this issue
Apr 30, 2024
binaryDiv
added a commit
that referenced
this issue
Apr 30, 2024
binaryDiv
added a commit
that referenced
this issue
Apr 30, 2024
binaryDiv
added a commit
that referenced
this issue
Apr 30, 2024
binaryDiv
added a commit
that referenced
this issue
Apr 30, 2024
Integrate mypy into development process (part of #116)
binaryDiv
added a commit
that referenced
this issue
Apr 30, 2024
binaryDiv
added a commit
that referenced
this issue
Apr 30, 2024
binaryDiv
added a commit
that referenced
this issue
Apr 30, 2024
binaryDiv
added a commit
that referenced
this issue
Apr 30, 2024
binaryDiv
added a commit
that referenced
this issue
Apr 30, 2024
binaryDiv
added a commit
that referenced
this issue
Apr 30, 2024
binaryDiv
added a commit
that referenced
this issue
May 6, 2024
Add unit tests to mypy targets; fix typing in tests (part of #116)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
enhancement
Improvements to existing features or smaller new features
refactoring
Code refactoring, clean up and other code maintenance work.
testing
Related to testing (e.g. unit tests)
This issue consists of two major parts: First, integrate mypy as a static type checker in the dev and build process of the library (and fix issues that mypy finds). Second, try to find out how to make validataclass compatible with mypy (i.e. in projects that use validataclass and mypy).
Use mypy to check the library code
/src
to the target files for now, but add a comment to add/tests
later too.# type: ignore
for now, maybe create issues for them)/tests
to the mypy config yet)Make validataclass fully mypy-compatible
foo: int = IntegerValidator()
- it's a validator, not an int.int
toOptionalUnset[int]
)x is not UnsetValue
does not narrow down the type, and evaluating as booleanif x:
doesn't either. (For the latter: would it help to declare the type ofUnsetValueType.__bool__
asLiteral[False]
?)The text was updated successfully, but these errors were encountered: