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
It would be very useful to be able to inspect the type annotations of live objects whose types are defined in pyi files. Merging type annotation with inspect.getargspec would open up a word of possibilities in python, such as automatic UI generation for functions/classes.
As an experiment, I tried the following (yes I know imp is deprecated):
Sorry, this just isn't going to happen any time soon. Apart from overload there are other reasons why the code in stubs just isn't importable (e.g. forward references).
Your request also blurs the line between mypy and runtime support.
It would be very useful to be able to inspect the type annotations of live objects whose types are defined in pyi files. Merging type annotation with
inspect.getargspec
would open up a word of possibilities in python, such as automatic UI generation for functions/classes.As an experiment, I tried the following (yes I know
imp
is deprecated):This failed because of the use of
@overload
in the pyi file. Commenting these out got the test working. So, there's at least two problems to solve:typing.get_type_hints
or a new utility inmypy
automatically fallback to searching for .pyi files. might be related to Search procedure for inline annotations #1190The text was updated successfully, but these errors were encountered: