partial_bind is failing to preserve self when handed a bound method, probably because the signature is inspected after wrapping non-coroutines. Inspecting first should take care of the problem.
minimal repro:
class Object:
def handle(self, host, port):
print("Connected: {} {}".format(host, port))
obj = Object()
bound_method = obj.handle
import asnycio
import bottom
client = bottom.Client("localhost", "8080")
client.on("client_connect")(bound_method)
# Throws when connecting because Object.handle gets params "host" and "port" but not "self"
asyncio.get_event_loop().run_until_complete(client.run())
partial_bind
is failing to preserveself
when handed a bound method, probably because the signature is inspected after wrapping non-coroutines. Inspecting first should take care of the problem.minimal repro: