You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Your second method would indeed be how it should work.
As it is currently, argument decorators flat out ignore anything indicated on their first parameter, because it is entirely determined by the parameter that was originally annotated:
# clize never looks at this
@argument_decorator
def level_2(arg, b):
...
# `arg`'s annotation is ignored
@argument_decorator
def level_1(arg: level_2, a):
...
# The specifics of `param` (e.g. it being an option/named parameter) completely override anything supplied by `level_1`.
def main(*, param: level_1):
...
I'll see if some special handling can be done for argument_decorator, else this will have to wait until #24
Salut @epsy. 👋
It seems that if you have two
@argument_decorator
decorated functions and want to use one inside the other, it's currently impossible.Intuitively, I'd have expected it to work by:
What's your recommandation on this? Would you see yourself implement one of those two examples?
The text was updated successfully, but these errors were encountered: