Type problem on Windows

Andrew Kuchling akuchlin at mems-exchange.org
Sat Jun 10 19:22:59 EDT 2000


Moshe Zadka <moshez at math.huji.ac.il> writes:
> The answer is yet again "don't do that". Never ever check type sanity in
> Python. If the object is good enough, your function will work with it. And
> if it isn't, well, it will raise a TypeError or AttributeError itself.

In Python 1.6, optional SSL support has been added to the socket
module.  An SSL socket is represented by a different type, so
explicitly checking for the socket type will mean that callers can't
use SSL sockets to run the protocol being implemented.  Another
argument in being a bit sloppy with the type-checking...

--amk





More information about the Python-list mailing list