1
Vote

Infer variable types from comparisons

description

Given this code:
def f(a, b):
    if a < 10 or b != 'abc':
        raise ValueError
We should be able to infer that a is expected to be an int and b a string. This could be extended to sequences (for ..., iter(...)), lists (x[integer]) and dictionaries (x[non-integer]) and would make our parameter information much richer than relying solely on calls.

comments