For those of you who know everything about the basic python syntax & semantics
...
I get stuck in a simple context issue (i think)
this version works, it return the stored float value
def rewrite( d ):
for key in d:
for k in d[key]['next']:
c = float(d[key]['next'][k]['prob'])
d[key]['next'][k]['prob'] = c
return d
this doesn't
if i call the function it will return a (random?) identical value for all
stored lambda functions.
def rewrite( d ):
for key in d:
for k in d[key]['next']:
c = float(d[key]['next'][k]['prob'])
d[key]['next'][k]['prob'] = lambda : c
return d
There is most likely a reason to it.
Can someone explain me what that reason is ?
Thanks!
.Floris
_______________________________________________
Python-nl mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-nl