[Python-Dev] Very Strange Argument Handling Behavior

Steve Holden steve at holdenweb.com
Sat Apr 17 21:03:44 CEST 2010


Dino Viehland wrote:
> Maciej wrote:
[...]
>> And yet that breaks some code :-)
> 
> Sure, if you do:
> 
> class C(object):
>     locals()[object()] = 42
> 
> dir(C)
> 
> You lose.  Once I'm aware of some piece of code in the wild doing this
> then I'll be happy to change IronPython to be more compatible. :)
> 
> 
This would be a lose anyway, since the CPython specifications suggest
that you should not rely on being able to change locals() (or at least
shouldn't expect that such changes are actually reflected in the local
namespace).

regards
 Steve
-- 
Steve Holden           +1 571 484 6266   +1 800 494 3119
See PyCon Talks from Atlanta 2010  http://pycon.blip.tv/
Holden Web LLC                 http://www.holdenweb.com/
UPCOMING EVENTS:        http://holdenweb.eventbrite.com/


More information about the Python-Dev mailing list