Closed
Description
Improve type inference by making it possible to infer the type of a variable from multiple (conditional) assignments.
This should be valid:
x = None
if c:
x = 'a'
# type of x is str
Another example:
if c:
x = None
else:
x = 'a'
# type of x is str
Later on, we could extend this to precise typing of None values using union types.
Edit: restricted this issue to multiple initialization.