title: Serialize a function of a class without serializing the class itself
body: <p>I'm using pyro5, and I want to make a remote object function as a worker class, where a client can ask it to perform various tasks by sending it functions to execute.</p>
  <p>For this to work, I need to serialize functions, but the serializers available through Pyro5 does not support serializing functions.</p>
  <p>Instead, I intend to use Dill, and somehow send the already serialized function through Pyro5.</p>
  <p>However, when trying to serialize a function, I receive errors which say that I can't serialize X, where X is the enclosing class where the function lives. How can I prevent this from happening?</p>
  <p>Actually, I was not able to reproduce this in a small script with a class and a function. I am running the dill serializer in a Qt app, not sure if that's the problem?</p>
  <p>Alternatively, does anyone have a better idea on how to approach this?</p>