-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
There should be an option to process TYPE_CHECKING #484
Comments
Would you consider becoming a maintainer for Typeguard? I don't have the bandwidth to keep up the development, as I'm mired in developing many other projects. |
This, for example, is a major effort for a run-time type checker which does not normally even see the |
I would happily, but unfortunately I'm not up to the task. :( |
You mean they're somehow excluded from the source tree when importing the module? Is it possible to just set I was thinking that you're making a special effort to look into |
A run-time type checker just sees what's there at run time, it doesn't normally inspect the source code, and this isn't even always possible (like in the REPL). Normally, if Typeguard goes out of its way to parse and modify the source code, but that comes with an additional, massive increase to complexity and a performance hit that some users are unhappy with.
That's not a viable option. In these blocks, it's customary to do things that don't work at all at run time, like importing Typeshed types. |
Well, everything I talk about here is only an option. |
Things to check first
Feature description
It would be nice for
typeguard
to actually process what's inside theif TYPE_CHECKING
blocks, actually importing the referenced modules etc.It would be nice to have an option to turn on this behavior.
Use case
That's not how an app would work without
typeguard
, but that would allow to check the app for type correctness more thoroughly.The text was updated successfully, but these errors were encountered: