Message24416
Logged In: YES
user_id=1230541
Obviously I forgot a statement in my previous comment's
code example. So here's the complete version:
n=2
def f(x): return n*x
del n
f(2)
# the Python implementation will result in a name error here.
But what should happen if Python had bound variable n at the
time of f's definitionf?
# let's define n again
n=3
f(2)
# the implementation will return 6, but how about your
expected implementation?
|
|
Date |
User |
Action |
Args |
2007-08-23 14:29:50 | admin | link | issue1153622 messages |
2007-08-23 14:29:50 | admin | create | |
|