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
{{ message }}
Repository navigation
Add decorator that automatically infers signature based on type annotations #119
It would be great to have a decorator that would not need an explicit parameter signature , when all of a functions parameters were annotated using typing capabilities. If this possibily already exists please tell me how it's done.
Right now I have to / can use the dispactch decorator like this:
Using that seems kind of clunky, since you have to use @fun.register also. As stated above I was thinking of a interface similar to multidispatch without to need to redundantly provide types to the decorator.
Activity
astanziola commentedon Jan 14, 2022
Isn't that what
functools.singledispatchdoes? https://docs.python.org/3/library/functools.htmlToniBig commentedon Jan 14, 2022
Using that seems kind of clunky, since you have to use
@fun.registeralso. As stated above I was thinking of a interface similar to multidispatch without to need to redundantly provide types to the decorator.cocolato commentedon Feb 17, 2022
I think it is auto inferred now:
JuanFMontesinos commentedon Apr 1, 2022
It doesn't work when there are kwargs unless explicity stated:
Works
Doesn't work