Pyro5.compatibility.Pyro4 — Pyro4 backward compatibility layer

An effort to provide a backward-compatible Pyro4 API layer, to make porting existing code from Pyro4 to Pyro5 easier.

This only works for code that imported Pyro4 symbols from the Pyro4 module directly, instead of from one of Pyro4’s sub modules. So, for instance: from Pyro4 import Proxy instead of: from Pyro4.core import Proxy

some submodules are more or less emulated such as Pyro4.errors, Pyro4.socketutil.

So, you may first have to convert your old code to use the importing scheme to only import the Pyro4 module and not from its submodules, and then you should insert this at the top to enable the compatibility layer: from Pyro5.compatibility import Pyro4

class Pyro5.compatibility.Pyro4.Daemon(host=None, port=0, unixsocket=None, nathost=None, natport=None, interface=<class 'Pyro5.server.DaemonObject'>, connected_socket=None)
class Pyro5.compatibility.Pyro4.Proxy(uri, connected_socket=None)
class Pyro5.compatibility.Pyro4.URI(uri)
Pyro5.compatibility.Pyro4.behavior(instance_mode: str = 'session', instance_creator: Callable | None = None) Callable

Decorator to specify the server behavior of your Pyro class.

Pyro5.compatibility.Pyro4.callback(method: Callable) Callable

decorator to mark a method to be a ‘callback’. This will make Pyro raise any errors also on the callback side, and not only on the side that does the callback call.

Pyro5.compatibility.Pyro4.expose(method_or_class: _T) _T

Decorator to mark a method or class to be exposed for remote calls. You can apply it to a method or a class as a whole. If you need to change the default instance mode or instance creator, also use a @behavior decorator.

Pyro5.compatibility.Pyro4.oneway(method: Callable) Callable

decorator to mark a method to be oneway (client won’t wait for a response)