Skip to content

Ability to resolve an unregistered function #13

@simonw

Description

@simonw

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions