[issue38933] unusual behaviour on list of dependable lambdas

Vedran Čačić report at bugs.python.org
Thu Nov 28 03:26:47 EST 2019


Vedran Čačić <vedgar at gmail.com> added the comment:

Yes, I never really understood what problem people have with it. If I manually say

i = 0
f = lambda a: a[i]
i = 1
g = lambda a: a[i]

why does anyone expect functions f and g to be different? They have the same argument, and do the same thing with it. The bytecode is completely the same. How can they do different things?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38933>
_______________________________________


More information about the Python-bugs-list mailing list