Skip to content

Echo64¤

An example of a 64-bit echo client.

Echo32 is the 32-bit server class and Echo64 is the 64-bit client class. These Echo classes do not actually communicate with a library. The point of these Echo classes is to show that a Python data type in a 64-bit process appears as the same data type in the 32-bit process and vice versa (provided that the data type is pickleable.)

Echo64 ¤

Echo64()

Bases: Client64

Example that shows Python data types are preserved between Echo32 and Echo64.

Source code in src/msl/examples/loadlib/echo64.py
21
22
23
def __init__(self) -> None:
    """Example that shows Python data types are preserved between [Echo32][] and [Echo64][]."""
    super().__init__("echo32", append_sys_path=Path(__file__).parent)

send_data ¤

send_data(*args, **kwargs)

Send a request to Echo32.received_data.

Parameters:

Name Type Description Default
args Any

The arguments to send.

()
kwargs Any

The keyword arguments to send.

{}

Returns:

Type Description
tuple[tuple[Any, ...], dict[str, Any]]

The args and kwargs that were sent.

Source code in src/msl/examples/loadlib/echo64.py
25
26
27
28
29
30
31
32
33
34
35
36
def send_data(self, *args: Any, **kwargs: Any) -> tuple[tuple[Any, ...], dict[str, Any]]:
    """Send a request to [Echo32.received_data][msl.examples.loadlib.echo32.Echo32.received_data].

    Args:
        args: The arguments to send.
        kwargs: The keyword arguments to send.

    Returns:
        The `args` and `kwargs` that were sent.
    """
    reply: tuple[tuple[Any, ...], dict[str, Any]] = self.request32("received_data", *args, **kwargs)
    return reply