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
First, I want to thank the maintainers of this tool for doing a spectacular job, Ruff is a joy to use! 🚀
I'll begin the issue with a small reproduction:
classA:
passclassB:
deff(self) ->A:
returnA()
deffoo(b: B) ->None:
defbar(x: A=b.f()) ->None: # Do not perform function call `b.f` in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable [B008]print(x)
bar(A())
When using flake8-bugbear's extend-immutable-calls section, I could ignore b.f. In Ruff, I can't, because I don't have a fully qualified path to it. I tried adding B.f to extend-immutable-calls, but it didn't work.
Is there a way to ignore such a thing using extend-immutable-calls? Thanks! 🙏
The text was updated successfully, but these errors were encountered:
Hmm, no, I don't think there's a way to do it today. Ruff's code that is used to resolve a name (e.g. B.b) doesn't understand following arguments but it would be required to understand that b is typed as B.
Hey all,
First, I want to thank the maintainers of this tool for doing a spectacular job, Ruff is a joy to use! 🚀
I'll begin the issue with a small reproduction:
When using flake8-bugbear's
extend-immutable-calls
section, I could ignoreb.f
. In Ruff, I can't, because I don't have a fully qualified path to it. I tried addingB.f
toextend-immutable-calls
, but it didn't work.Is there a way to ignore such a thing using
extend-immutable-calls
? Thanks! 🙏The text was updated successfully, but these errors were encountered: