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
Types imported from the typing module are excempt from moving into TYPE_CHECKING by default because you still have to import the typing module to get the TYPE_CHECKING variable at runtime. So the benefit of moving types imported from typing is marginal. See Charlie's response here #9197 (comment)
However, you can remove typing from the excempt-module list and ruff will start enforcing moving typing imports in the TYPE_CHECKING block
I additionally had this confusion come up outside the typing module, but I realize now from the issue you linked that the behavior I was seeing is explained by the strict = false default.
Summary
It seems that some of the
TC
rules are not working correctly. For example, if I have this file:and I run
then I get that all checks pass.
My understanding is that this should yield a
TC003
error. Am I misunderstanding the intended behavior?Version
0.9.4
The text was updated successfully, but these errors were encountered: