I'd like to be able to do the following:
async def one():
return 1
async def two():
return 2
registry = Registry(one, two)
async def three(one, two):
return one + two
result = await registry.resolve(three)
Note that three has not been registered with the registry - but it still has its parameters inspected and used to resolve the dependencies.
This would be useful for Datasette, where I want plugins to be able to interact with predefined registries without needing to worry about picking a name for their function that doesn't clash with a name that has been registered by another plugin.
I'd like to be able to do the following:
Note that
threehas not been registered with the registry - but it still has its parameters inspected and used to resolve the dependencies.This would be useful for Datasette, where I want plugins to be able to interact with predefined registries without needing to worry about picking a name for their function that doesn't clash with a name that has been registered by another plugin.