Prefer a micropython answer but will accept CPython
I'm implementing a Python function in C.
How do you apply a decorator to Python function written in C?
Prefer a micropython answer but will accept CPython
I'm implementing a Python function in C.
How do you apply a decorator to Python function written in C?
Decorators can be invoked with a function as their argument. So if you would have written this (in Python):
You can instead write this:
You can then move
myimpl
to C.If your decorator takes arguments: