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
After #3024, mypy won't complain when inferring the type of a variable as None. Unfortunately, in some circumstances we drop information about the variable that makes this invalid. For example:
T=TypeVar('T')
deff(*x: T) ->Dict[int, T]: passx=Noneifbool():
x=f()
reveal_type(x) # E: Revealed type is 'builtins.None'
Activity
ddfisher commentedon Mar 19, 2017
See also:
testPartiallyInitializedToNoneAndThenToIncompleteType.Discard partials remaining after inference failure (python#20126)