Martin v. Loewis
martin at v.loewis.de
Sun Mar 24 23:12:40 CET 2002
Robin Becker <robin at jessikat.fsnet.co.uk> writes:
> yes I heard about that, but the semantics seem strange to me.
> open is not a file it is a function that produces an open file.
It used to be a function that produces an open file, now it is a type
that produces an open file. Watch this:
>>> import httplib
>>> print h
<httplib.HTTP instance at 0x816b85c>
So even though httplib.HTTP is a class (something that is very similar
to a type), you still can call it. Calling a type makes an instance of
> It's now not even amongst the built ins.
I don't understant this remark. open is certainly amongst the
> what does X==type(X()) imply?
It implies that X is a type; calling a type gives an instance of the
More information about the Python-list