-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
boolean-positional-value-in-call
(FBT003
) - don't warn when function name starts with set_
and only takes one argument
#8923
Comments
This seems a little bit too specific to me. |
We may want to do this, it would also help with #9287 and #3247 (comment). |
Maybe also allow the torch.use_deterministic_algorithms(mode=True) |
I'm kind of wondering if we should just avoid calling this on third-party function calls. |
I often use flag-holding context vars. from contextvars import ContextVar
cv = ContextVar("cv", default=False)
cv.set(True) # triggers FBT003 What a pity the fix for this doesn't apply to |
it looks like the check expects the function name to start with "set" followed by either an underscore or an uppercase character, but not "set" on its own. it should probably be updated to allow that too. |
It seems reasonable to expand it to cover that case. |
functions like these should not report the error imo, since the meaning of the bool is self explanatory, which is often the case when the functin starts with
set_
:The text was updated successfully, but these errors were encountered: