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)
return function
def rpc(function, flags={}):
"""Decorates a function declaration defined by the core device runtime."""
register_function(function)
@wraps(function)
def wrapped(function)
return function
wrapped.__artiq_rpc_flags__ = flags
return wrapped
def rpc(arg=None, flags={}):
"""Decorates a function or method to be executed on the host interpreter."""
if arg is None:
def inner_decorator(function):
return rpc(function, flags)
return inner_decorator
register_function(arg)
return arg
def kernel(function_or_method):
"""Decorates a function or method to be executed on the core device."""