-
Notifications
You must be signed in to change notification settings - Fork 2
Support for mypy #116
Copy link
Copy link
Closed
Labels
enhancementImprovements to existing features or smaller new featuresImprovements to existing features or smaller new featuresrefactoringCode refactoring, clean up and other code maintenance work.Code refactoring, clean up and other code maintenance work.testingRelated to testing (e.g. unit tests)Related to testing (e.g. unit tests)
Milestone
Metadata
Metadata
Assignees
Labels
enhancementImprovements to existing features or smaller new featuresImprovements to existing features or smaller new featuresrefactoringCode refactoring, clean up and other code maintenance work.Code refactoring, clean up and other code maintenance work.testingRelated to testing (e.g. unit tests)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
/srcto the target files for now, but add a comment to add/testslater too.# type: ignorefor now, maybe create issues for them)/teststo the mypy config yet)Make validataclass fully mypy-compatible
foo: int = IntegerValidator()- it's a validator, not an int.inttoOptionalUnset[int])x is not UnsetValuedoes 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]?)