Replies: 1 comment
-
Hmm, that's interesting, thanks! We have a closely related rule in literal-membership (PLR6201), but it recommends a set literal in both the list and tuple cases here, which also sounds like it wouldn't help type checkers. We'd have to figure out how to resolve that conflict before we could add a rule suggesting a tuple instead. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This suggestion is based on this discussion, where I learned that since tuples are immutable, it helps type checkers to infer more precise types:
Personally, I would prefer the first solution from now on.
Does this rule makes sense for you?
Beta Was this translation helpful? Give feedback.
All reactions