This PR adds Optional[] to type hints for parameters that can take None. This is useful when running mypy on code consuming Dunami as a library. Otherwise you get type errors from mypy when passing None as an argument to these functions.
error: Argument "metadata" to "serialize" of "Version" has incompatible type "Optional[bool]"; expected "bool"
I also updated the .pre-commit-config.yaml to run mypy with the --no-implicit-optional flag to catch parameters that should be marked as Optional in the future.
This PR adds
Optional[]
to type hints for parameters that can takeNone
. This is useful when running mypy on code consuming Dunami as a library. Otherwise you get type errors from mypy when passingNone
as an argument to these functions.I also updated the
.pre-commit-config.yaml
to run mypy with the--no-implicit-optional
flag to catch parameters that should be marked asOptional
in the future.Thank you for the very helpful library! 🙏🏻