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
This should type-check under --strict-optional, but currently the type of a or 'default' is inferred as Optional[str]. It should realize that if a is None the right branch is always taken.
The text was updated successfully, but these errors were encountered:
gvanrossum
changed the title
Improve type inference for Optional[x]
Improve type inference for "Optional[T] or T" expression
Jul 7, 2016
Uh oh!
There was an error while loading. Please reload this page.
Consider this:
This should type-check under
--strict-optional
, but currently the type ofa or 'default'
is inferred asOptional[str]
. It should realize that if a isNone
the right branch is always taken.The text was updated successfully, but these errors were encountered: