-
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
FURB171 Does not trigger when calling set(...) #15792
Comments
These two are not equivalent: >>> set(1)
Traceback (most recent call last):
File "<python-input-0>", line 1, in <module>
set(1)
~~~^^^
TypeError: 'int' object is not iterable |
Sorry about that. Edited the original post, it should be >>> set([1]) == {1}
True |
I'm not sure if the scope of the rule should be extended to include composite constructions of singleton collections. There would be a lot of special cases to consider and it's not clear to me how one would draw the line for what should or shouldn't be considered. Already in this case if we add |
@AlexWaygood has convinced me that this extension in scope has more pros than cons - thanks for suggesting it, and sorry for delaying things a bit! |
Description
Minimal code snippet:
Command:
ruff check --isolated testfile.py --select FURB171 --preview
No other settings.
Ruff version 0.9.3.
The text was updated successfully, but these errors were encountered: