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
Sure the logic in my packege pyoload will help.
We could:
Simply runtime check all the functions and skip all thos raising an exception
Building A custom argument matcher which will do the typecheck for you
pyoload uses the first a thus supports overloads with different parameter list length and further recursive argument casting... but I won't expose on that, imaging
This is a bit of a tricky one, but suppose you had something like the following:
It would be cool if the correct overload could be narrowed down to and validated with the arguments at runtime.
There has been some discussion in the official
typing
repo on how to accomplish this:python/typing#711
The gist is to inject a custom
@overload
implementation. I imagine there'd be work in tricking intellisense servers into thinking it's the original.The text was updated successfully, but these errors were encountered: