Is your feature request related to a problem? Please describe.
Currently the activity definition implementation here requires __code__ on a callable. From what I can tell it seems like it's only using that to verify that there are no kwonly arguments.
Describe the solution you'd like
We can instead use the inspect module to analyze the callable's signature, allowing a broader set of non-function callables to be used as activities.