def blah(self, args):
def do_blah():
if not args:
args = ['blah']
for arg in args:
print arg
the above raise an error at if not args
saying UnboundLocalError: local variable 'args' referenced before assignment.
def blah(self, args):
def do_blah():
for arg in args: <-- args here
print arg
but this works despite using args
why is the first one not using the blah's args in if not args:
?