You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When adding annotations, how do I annotate x? Assuming complex_func() returns a T, then
x: _Missing|T=complex_func()
seems correct. But _Missing is an internal detail, not part of marshmallow's exports.
It is not necessary for x to ever have a value of missing if you have another sentinel value to use (e.g. None works for many cases). I've refactored to handle this in my specific case, so there's no urgency here.
I have a branch which renames _Missing to MissingType, exposes it, and sets _Missing = MissingType as a bit of compatibility for anyone using it. But I'm not sure if I should submit the PR?
The text was updated successfully, but these errors were encountered:
I realized after posting that there's a lot more going on in my code than just a Raw field to handle the missing that comes through -- multiple nested schemas -- but I'm not sure how best to formulate a simple example that demonstrates this.
I'll leave it as-is for now, but the main point is that there is code which may use missing as a non-None sentinel value.
I almost filed a PR to make this change, but then I realized that the desirability of this is non-obvious.
I have some code which manipulates a variable like so in a pre-dump hook:
When adding annotations, how do I annotate
x
? Assumingcomplex_func()
returns aT
, thenseems correct. But
_Missing
is an internal detail, not part ofmarshmallow
's exports.It is not necessary for
x
to ever have a value ofmissing
if you have another sentinel value to use (e.g.None
works for many cases). I've refactored to handle this in my specific case, so there's no urgency here.I have a branch which renames
_Missing
toMissingType
, exposes it, and sets_Missing = MissingType
as a bit of compatibility for anyone using it. But I'm not sure if I should submit the PR?The text was updated successfully, but these errors were encountered: