Hi,

Adrien Di Mascio:
> tests for type(fp) == type('') but since fp is a unicode string, this
> piece of code thinks that if it is not a string, it must be an open
> file.
> 
The correct way to do that is probably to check whether it has a read()
method. Alternately, you can check if it's an instance of basestring.

The types module is somewhat deprecated.

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  [EMAIL PROTECTED]

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Shtoom mailing list
[email protected]
http://mail.python.org/mailman/listinfo/shtoom

Reply via email to