type enforcement in _ssl.sslwrap

Eric Snow esnow at verio.net
Tue Aug 10 19:40:54 CEST 2010


ssl.SSLSocket.__init__ makes a call to _ssl.sslwrap (in the C
module).  That in turn makes a call to PyArg_ParseTuple, which casts
the first arg of _ssl.sslwrap into a PySocketModule.Sock_Type
object.

My problem is that I am trying to pass in an object that implements
the Socket interface, but does not inherit from _socket.socket, like
you do with file-like objects.  Is there a way to make this work, or
is the PyArg_ParseTuple call going to stop me.  Would I need to have
_ssl.sslwrap do something differently with its args?

-eric



More information about the Python-list mailing list