flake8-builtins (A)
rules that shouldn't apply to stubs
#15293
Labels
rule
Implementing or modifying a lint rule
The following I'm pretty sure should be disabled in stubs, as they are out of a stub author's control:
This happens with aliases and other top-level variables. Non-runtime type aliases should be private in the first place. Devs also shouldn't try to import builtins from a module that happens to import said builtin. And finally this rule mostly tries to protect against using the shadowed variable. In a typing-only context, you should mostly be guarded by type tests anyway.
flake8-builtins
] DisapplyA005
to stub files #15350)As for the rest:
Very similar as
A001
but can actually be worked around with import aliases and re-export aliases. (which would triggerA001
instead)Could maybe be ignored in stubs if re-exported ? (
import print as print
,from tensorflow.math import abs as abs
,import foo as print; print = print
andimport foo as print; __all__= ["print"]
)I don't think lambdas apply to type stubs anyway. Probably doesn't need to be ignored.
Ruff: 0.8.5
(this report is extracted from #14535 (comment) and #14535 (comment) for ease of tracking and discussion)
The text was updated successfully, but these errors were encountered: