From 05d8dde412c5159cd0e0f931a0a37658b087bcce Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 30 Sep 2014 16:43:00 +0800 Subject: [PATCH] language/core: pass docstrings through kernel decorator --- artiq/language/core.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/artiq/language/core.py b/artiq/language/core.py index eabc04a96..0449f1dfe 100644 --- a/artiq/language/core.py +++ b/artiq/language/core.py @@ -2,6 +2,7 @@ from collections import namedtuple as _namedtuple from copy import copy as _copy +from functools import wraps as _wraps class int64(int): @@ -204,6 +205,7 @@ def kernel(arg): """ if isinstance(arg, str): def real_decorator(k_function): + @_wraps(k_function) def run_on_core(exp, *k_args, **k_kwargs): getattr(exp, arg).run(k_function, ((exp,) + k_args), k_kwargs) run_on_core.k_function_info = _KernelFunctionInfo( @@ -211,6 +213,7 @@ def kernel(arg): return run_on_core return real_decorator else: + @_wraps(arg) def run_on_core(exp, *k_args, **k_kwargs): exp.core.run(arg, ((exp,) + k_args), k_kwargs) run_on_core.k_function_info = _KernelFunctionInfo(