chore: use if TYPE_CHECKING: blocks#2866
Conversation
freakboy3742
left a comment
There was a problem hiding this comment.
All makes sense to me
|
After further thoughts, we might want to:
Any thoughts ? |
|
I've implemented the proposal from the previous comment in #2869 |
|
I like this version fine - In timings, I'm fine to keep tests consistent, though I don't really care, we don't have to. |
|
I don't have a strong opinion, but the |
Just as a note, I closed the other PR and kept this one as I don't have a strong opinion either. |
This will become the default in Python 3.14 in any case given the current lint rules.
It ensures typing only imports do not slow down execution (admittedly only useful in edge use cases, such as querying help).
If #2797 makes it, it will further speed-up this one: