Skip to content
Discussion options

You must be logged in to vote

Further confirmation that Ruff is fundamentally insane, huh? Literally everything the Ruff documentation claims at TCH003 is unsubstantiated bald-faced lies that harm the CPython runtime. Notably, this:

Unused imports add a performance overhead at runtime...

Negligible. CPython trivially caches imported modules at sys.modules. Ruff, you are spouting nonsensical gibberish to support your spurious claims – and we ain't havin' none of it.

If an import is only used in typing-only contexts, it can instead be imported conditionally under an if TYPE_CHECKING: block to minimize runtime overhead.

No. There is no such thing as "typing-only contexts." Due to type aliases (e.g., MuhTypeAlias = li…

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by RomainBrault
Comment options

You must be logged in to vote
1 reply
@leycec
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants