In Python 3, using PyGobject, the callback signature seems to be:

def connection_callback(client: Gio.SocketClient, task: Gio.Task, user_data):

but maybe there is extra jiggery-pokery going on under the covers to deliver a Task?