[Tutor] Is socket.socket() a func or a class

Khalid Al-Ghamdi emailkgnow at gmail.com
Fri Apr 6 08:10:40 CEST 2012


hi all,

I'm reading this book that says when creating a socket you have to use the
socket.socket() *function *as in :

ss=socket.socket()

but whey i check they type it says it's a class which makes sense cause
you're creating a socket object.

>>> type(ss)
<class 'socket.socket'>

so, which is it? or do authors loosely use these terms interchangeably in
this context?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20120406/83c21890/attachment.html>


More information about the Tutor mailing list