From 01521b5ed0cf8ba1cc8307a38e7841104acb589c Mon Sep 17 00:00:00 2001 From: Drew Risinger Date: Wed, 9 Jan 2019 12:32:19 -0500 Subject: [PATCH] pc_rpc: remove type annotations per @sbourdeauducq --- artiq/protocols/pc_rpc.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/artiq/protocols/pc_rpc.py b/artiq/protocols/pc_rpc.py index ed1b0b96d..2152a9961 100644 --- a/artiq/protocols/pc_rpc.py +++ b/artiq/protocols/pc_rpc.py @@ -488,10 +488,20 @@ class Server(_AsyncioServer): self._noparallel = asyncio.Lock() @staticmethod - def _document_function(function: typing.Callable) -> typing.Tuple[dict, str]: - """Turn a function into a tuple of its arguments and documentation. + def _document_function(function): + """ + Turn a function into a tuple of its arguments and documentation. - Allows remote inspection of what methods are available on a local device.""" + Allows remote inspection of what methods are available on a local device. + + Args: + function (Callable): a Python function to be documented. + + Returns: + Tuple[dict, str]: tuple of (argument specifications, + function documentation). + Any type annotations are converted to strings (for PYON serialization). + """ argspec_dict = dict(inspect.getfullargspec(function)._asdict()) # Fix issue #1186: PYON can't serialize type annotations. if any(argspec_dict.get("annotations", {})):