no detection of undefined parameters in else branches

Bug #1597279 reported by Wilfred Hughes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Pyflakes
New
Undecided
Unassigned

Bug Description

pyflakes correctly warns on using x before defining it in the if branch:

def bar(a):
    pass

def x_is_bad_if():
    if False:
        x = bar(x)
    else:
        x = bar(1)

    return x

However, no warning is generated for the else branch:

def bar(a):
    pass

def x_is_bad_else():
    if False:
        x = bar(1)
    else:
        x = bar(x)

    return x

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.