tombulled / param

Enhanced function parameters
https://pypi.org/project/tombulled-param/
MIT License
0 stars 0 forks source link

:sparkles: Make specifying resolvers optional #16

Open tombulled opened 2 years ago

tombulled commented 2 years ago

Make specifying a resolver optional. The user may only ever want to use get_params, not get_arguments. E.g:

R = TypeVar("R", bound=Callable)

class Resolvers(Register[Type[ParameterSpecificafion], Optional[R]]):
    pass

class MyManager(ParameterManager):
    resolvers = {Param: None}

Chaining on from this, ParameterManager.resolve is currently an abstractmethod, however the user may have no desire to implement one. Perhaps it should throw an UnresolvableParameter exception by default instead.