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
Is only a partial function. If x is a str, then this function actually returns None.
Thus the output type should really be Union[str, NoneType]
I tested this snippet and mypy doesn't seem to catch this.
I'm not 100% sure, but I think if a function is partial, NoneType is a potential return type.
The text was updated successfully, but these errors were encountered:
In a lot of typed languages, the compiler can be told to check if a function is total, handles all cases.
For Example:
Is only a partial function. If
x
is astr
, then this function actually returnsNone
.Thus the output type should really be
Union[str, NoneType]
I tested this snippet and mypy doesn't seem to catch this.
I'm not 100% sure, but I think if a function is partial,
NoneType
is a potential return type.The text was updated successfully, but these errors were encountered: