tombulled / param

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

DevLog #6

Closed tombulled closed 1 year ago

tombulled commented 2 years ago

Implement .models.BoundArguments

tombulled commented 2 years ago

Implement .enums.ParameterType.from_kind

tombulled commented 2 years ago

Implement Resolvers.get_resolver to get the most appropriate resolver

tombulled commented 2 years ago

api.get_params shouldn't care about PS/RT

tombulled commented 2 years ago

Re-implement use of arguments library?

tombulled commented 2 years ago

Remove last Param wrapper overload, it's invalid

tombulled commented 2 years ago

Make a ParameterManager ABC, and a concrete ParamManager

tombulled commented 2 years ago

Make get_params complain if a spec doesn't have a listed resolver

tombulled commented 2 years ago

Parameter inference will likely need access to more information? (Or should it just use instance attributes?)

Done

tombulled commented 2 years ago

Complain if inferred parameter has no associated resolver

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.

tombulled commented 2 years ago

Make get_params complain if a spec doesn't have a listed resolver