◐ Shell
clean mode source ↗

Message 269546 - Python tracker

> Rather tham monkey-patching, in general I recommend just copying some
code from the asyncio library and calling that. In this case you'd be
copying a tiny bit of code from create_connection(). You'd still be
calling an internal API, _make_ssl_transport(), but your code would
still be less likely to change when some part of the asyncio library
changes than with monkey-patching. 

But this kind of defeats the purpose of pluggable event loop etc.  I can't implement all asyncio private APIs for uvloop.  Once you start using that, your code can't run on uvloop or any other asyncio implementation.

> Maybe it's just culture shock? Or maybe we just need a public API that roughly represents the pair of calls to _make_ssl_transport() and _make_socket_transport() that are currently appearing both in _create_connection_transport() and in _accept_connection2(), plus some of the code around it that's a little tricky?

That's essentially what I wanted `loop.wrap_socket` to do (see msg269519)