Thursday, September 26, 2013

variable dis-assignment

>>> def foo():
...    a = 1
...    del a
...    return a
...
>>> foo()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 4, in foo
UnboundLocalError: local variable 'a' referenced before assignment


1 comment:

  1. A refund code or equestrian shop near me is on an astoundingly key level a blend of numbers and letters, which incomprehensibly enough depict the thought or markdown in some.

    ReplyDelete