Checking socket type?

Moshe Zadka moshez at math.huji.ac.il
Sat Jun 10 09:20:07 EDT 2000


On Sat, 10 Jun 2000, Jerome Chan wrote:

> How would I check to see if an object is an instance of a socket?

Use the type() function:

>>> type(socket.socket(socket.AF_INET, socket.SOCK_STREAM))
<type 'socket'>

--
Moshe Zadka <moshez at math.huji.ac.il>
http://www.oreilly.com/news/prescod_0300.html
http://www.linux.org.il -- we put the penguin in .com





More information about the Python-list mailing list