Author pjenvey
Recipients pjenvey
Date 2008-12-06.08:02:51
SpamBayes Score 3.13376e-09
Marked as misclassified No
Message-id <>
Our builtin module's __dict__s don't have what you'd expect to see in 
CPython, they contain the remnants of our Java Integration:

Jython 2.5b0+ (trunk:5704:5712M, Dec 5 2008, 22:53:44) 
[Java HotSpot(TM) 64-Bit Server VM (Apple Inc.)] on java1.6.0_07
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.version_info > (2, 4)
>>> sys.__dict__['version_info'] > (2, 4)
>>> sys.__dict__['version_info']
<reflected field public static org.python.core.PyTuple 
org.python.core.PySystemState.version_info 1>

Which makes these __dict__s fairly useless and error prone. Occasionally 
there is good reason to go directly into them -- e.g. when wanting to 
specify a module dict for the scope of an exec statement

On a somewhat related note, the fact that our builtin modules aren't 
actual modules (assert isinstance(sys, types.ModuleType)) can also be 
annoying. I only mention it here because I think that fact might want to 
be considered in any fix for __dict__. It's really a different issue, 
Date User Action Args
2008-12-06 08:02:53pjenveysetrecipients: + pjenvey
2008-12-06 08:02:52pjenveysetmessageid: <>
2008-12-06 08:02:52pjenveylinkissue1193 messages
2008-12-06 08:02:51pjenveycreate