This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients ezio.melotti, mark.dickinson, skrah, ubershmekel
Date 2010-07-01.11:48:51
SpamBayes Score 0.00010803766
Marked as misclassified No
Message-id <1277984933.84.0.973053159374.issue9136@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2010-07-01 11:48:53mark.dickinsonsetrecipients: + mark.dickinson, ezio.melotti, ubershmekel, skrah
2010-07-01 11:48:53mark.dickinsonsetmessageid: <1277984933.84.0.973053159374.issue9136@psf.upfronthosting.co.za>
2010-07-01 11:48:52mark.dickinsonlinkissue9136 messages
2010-07-01 11:48:51mark.dickinsoncreate