Replies: 5 comments 8 replies
-
By the way, I'm happy to work on this I just wanna pin down the "assignment" first. |
Beta Was this translation helpful? Give feedback.
This comment has been hidden.
This comment has been hidden.
-
Can you tell me a bit more about the reasons why not: {(foo, bar): "a", (foo, bar): "b"} Is it because the keys are tuples or because the tuples contain names? {
f"{foo}": "a",
f"{foo}": "b",
} Is it because the f-strings have replacements? What about f-strings without replacements? |
Beta Was this translation helpful? Give feedback.
-
IMO, explaining why the rule detects |
Beta Was this translation helpful? Give feedback.
-
I overall agree with this except that allocating ad-hoc expressions is somewhat expensive. Considering that the rule only has to deal with a very limited set of expressions: would it make sense to create an ad-hoc comparison instead? |
Beta Was this translation helpful? Give feedback.
-
This is an extension of #12772.
Observed issues
Playground Link
Potential Solution
I propose that the logic of this check (independently of the implementation) should be as follows:
Name
(that may be redundant since Name's are terminal?)ComparableExpr
's are equal after further replacing all boolean and numeric literals with their complex-valued equivalent (for these purposes, I think "large" integers should be left as is).repeated-key-literal
(and similarly for F602).Beta Was this translation helpful? Give feedback.
All reactions