I don't think it will work to match by the name of the function because there is no guarantee that the name will be unique. A better way would be to allow matching by the callable, as you had before, but also to add a 'name' argument to connect() that allows certain connections to be referenced by string (and in this case, connect(name='xxx') would fail if the name was already taken).