1
0
forked from M-Labs/nac3

remove flags from python decorator definition

This commit is contained in:
mwojcik 2024-09-12 14:46:17 +08:00
parent 94f0c467fa
commit 4659b16d5f

View File

@ -112,14 +112,15 @@ def extern(function):
register_function(function) register_function(function)
return function return function
def rpc(function, flags={}):
"""Decorates a function declaration defined by the core device runtime.""" def rpc(arg=None, flags={}):
register_function(function) """Decorates a function or method to be executed on the host interpreter."""
@wraps(function) if arg is None:
def wrapped(function) def inner_decorator(function):
return function return rpc(function, flags)
wrapped.__artiq_rpc_flags__ = flags return inner_decorator
return wrapped register_function(arg)
return arg
def kernel(function_or_method): def kernel(function_or_method):
"""Decorates a function or method to be executed on the core device.""" """Decorates a function or method to be executed on the core device."""