I am fairly new to python, I come from a strong C background however, and I was trying to figure out how this works: How can I use a SOCKS 4/5 proxy with urllib2?
The part I am having trouble understanding is that they overwrite socket.socket
yet socket.socket
is a 'type' as told by running type(socket.socket)
. So I am confused about how you are capable of overwriting a type like that, or is socket.socket
in this case actually a function they are redefining hence actually returning a different type? Normally if I run type
on a function it returns that its a function or a method or whatever.
I guess what I am really trying to understand is what is happening under the covers?