[Python-Dev] Thoughts on stdlib evolvement
Skip Montanaro
skip at pobox.com
Mon Jun 6 22:06:42 CEST 2005
>>>>> "Barry" == Barry Warsaw <barry at python.org> writes:
Barry> On Mon, 2005-06-06 at 14:38, Skip Montanaro wrote:
>> import urllib
>> from www.urllib import urlopen
>>
>> the module-level code should only be executed once, and
>>
>> urlopen == urllib.urlopen
>>
>> should evaluate to True.
Barry> Not to mention "urlopen is urllib.urlopen"
Whoops, yeah. I was thinking in terms of module-level functions and
classes, where I think == is sufficient:
>>> import foo2
>>> foo2.f
<function f at 0x38e6b0>
>>> g = foo2.f
>>> reload(foo2)
<module 'foo2' from 'foo2.pyc'>
>>> foo2.f == g
False
Obviously, for data objects "is" is what you want.
Skip
More information about the Python-Dev
mailing list