Message263986
In Python 2, using the exec statement makes the compiler disable fast locals:
>>> def foo(): pass
...
>>> def bar(): exec ''
...
>>> foo.__code__.co_flags & inspect.CO_OPTIMIZED
1
>>> bar.__code__.co_flags & inspect.CO_OPTIMIZED
0
This has never been the case in Python 3, in which exec() is a function instead of a statement. The exec function can be shadowed by a global named "exec", so the hack to disable fast locals was removed. |
|
Date |
User |
Action |
Args |
2016-04-22 09:01:55 | eryksun | set | recipients:
+ eryksun, xiang.zhang |
2016-04-22 09:01:55 | eryksun | set | messageid: <1461315715.38.0.256230430357.issue26825@psf.upfronthosting.co.za> |
2016-04-22 09:01:55 | eryksun | link | issue26825 messages |
2016-04-22 09:01:55 | eryksun | create | |
|