使用Pyro实例化课程

时间:2019-03-21 19:42:51

标签: python-3.x pyro pyro4

我有一个带有构造函数的类:

[obj.a, obj.b] = [obj.b, obj.a];

此类通过Pyro公开,但是我只能调用方法“ get”,因此opt的值始终为10,因为我无法使用其他值实例化该类。

您对如何解决这个问题有任何想法吗?

谢谢大家!

1 个答案:

答案 0 :(得分:0)

您可以使用其行为修饰器控制Pyro创建服务器类实例的方式。参见https://pyro4.readthedocs.io/en/stable/servercode.html#controlling-instance-modes-and-instance-creation

听起来像您想使用其instance_creator参数。