Nick Coghlan <[EMAIL PROTECTED]> writes:
Until this code:
.>>> import pdb .>>> pdb.True = 0 .>>> pdb.x = "Darn writeable module dictionaries" .>>> from pdb import True .>>> True 0 .>>> from pdb import x .>>> x 'Darn writeable module dictionaries'
If Python really does behave that way, that bug should be fixed immediately.
I tried it out in the 2.4 interpreter before posting it - it certainly does behave that way.
And some test frameworks do make use of the capability to inject behaviour into the module under test (e.g. the one mentioned here: http://mail.python.org/pipermail/python-list/2003-April/156301.html).
This is behaviour which has been around for a while - and breaking such expected behaviour gratuitously isn't acceptable.
PEP 267 discusses a way of speeding access to globals/builtins without giving up the external binding of names.
Cheers, Nick.
-- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --------------------------------------------------------------- http://boredomandlaziness.skystorm.net -- http://mail.python.org/mailman/listinfo/python-list