2.2 open

Robin Becker robin at jessikat.fsnet.co.uk
Sun Mar 24 09:40:59 EST 2002


I am just testing Python 2.2 and one of the oddities I have found is in
some code that used to test __import__.


if type(__import__) == type(open):
  .....

but now I see

>>> __import__
<built-in function __import__>
>>> type(__import__)
<type 'builtin_function_or_method'>
>>> open
<type 'file'>
>>> type(open)
<type 'type'>


So open is now a file? That seems a bit odd to me.

Certainly it's causing my version 4 McMillan installer code to flop
over.

It seems that some built ins now have the type of the object they
create. Pretty weird logic.  
-- 
Robin Becker



More information about the Python-list mailing list