Closed mesozoic closed 6 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 100.00%. Comparing base (
1040512
) to head (e969df6
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
We have several use cases where we want to
Our code winds up being peppered with "if value is None, do something, else ..." conditions, and it would be easier if we could declare that as a type checked property of the field. This branch adds support for that.
For example, given this code:
The following will all raise an exception:
It would have been simpler to implement this as a flag on the field's constructor, but with that approach I couldn't find a way to get mypy to understand that the type of
r.user_id
isint
and notOptional[int]
.