Message109045
Ah, it looks like 'locals()' is somewhat magical. Its docstring says:
"Update and return a dictionary containing the current scope's local variables."
So I think this explains your (Stefan's) results: in either case, you evaluate locals() (as the target of the for statement) and get a dictionary back. But that dictionary isn't updated to include 'name' and 'val' until you call locals() for a second time. (And possibly there are other activities besides an explicit locals() call that would cause that dict to be updated, but I'm not sure.)
I still don't understand how things work when profile is added into the mix, but I'm willing to accept that the profile module affects locals() in strange and possibly timing-dependent ways.
Anyway, the fix for decimal is clear: get rid of that locals call. |
|
Date |
User |
Action |
Args |
2010-07-01 11:48:53 | mark.dickinson | set | recipients:
+ mark.dickinson, ezio.melotti, ubershmekel, skrah |
2010-07-01 11:48:53 | mark.dickinson | set | messageid: <1277984933.84.0.973053159374.issue9136@psf.upfronthosting.co.za> |
2010-07-01 11:48:52 | mark.dickinson | link | issue9136 messages |
2010-07-01 11:48:51 | mark.dickinson | create | |
|