Message106523
> I'm guessing that somewhere in the python source there is some code that goes [...]
Unfortunately it's not nearly that simple. As I mentioned in my message on python-dev, the problem is that 'y' gets bound with a 'STORE_NAME' opcode, which puts 'y' into the locals dict, and then retrieved from within the function with a 'LOAD_GLOBAL' opcode, which looks in the globals dict; hence the NameError.
So should the compiler be generating a 'LOAD_NAME' instead of a 'LOAD_GLOBAL' for this code? I'm not really familiar with the compilation process, so I've no idea whether this makes sense, or what impact it might have on existing code. |
|
Date |
User |
Action |
Args |
2010-05-26 11:40:11 | mark.dickinson | set | recipients:
+ mark.dickinson, jhylton, arigo, georg.brandl, josiahcarlson, nickjacobson, ajaksu2, hawkett |
2010-05-26 11:40:11 | mark.dickinson | set | messageid: <1274874011.28.0.0768060752351.issue991196@psf.upfronthosting.co.za> |
2010-05-26 11:40:09 | mark.dickinson | link | issue991196 messages |
2010-05-26 11:40:08 | mark.dickinson | create | |
|