def wrap(cls, meth):
        '''
        Wraps a connection opening method in this class.
        '''

        async def inner(*args, **kwargs):
            sock = await meth(*args, **kwargs)
            return cls(sock)

        return inner
def wrap ( cls , meth ) : async def inner ( * args , ** kwargs ) : sock = await meth ( * args , ** kwargs ) return cls ( sock ) return inner
Wraps a connection opening method in this class.