-
Notifications
You must be signed in to change notification settings - Fork 0
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
Replace is
with ==
for literal or new object comparisons
#5
Replace is
with ==
for literal or new object comparisons
#5
Conversation
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Note Free review on us!CodeRabbit is offering free reviews until Wed Jan 15 2025 to showcase some of the refinements we've made. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
I'm confident in this change, but I'm not a maintainer of this project. Do you see any reason not to merge it? If this change was not helpful, or you have suggestions for improvements, please let me know! |
Just a friendly ping to remind you about this change. If there are concerns about it, we'd love to hear about them! |
This change may not be a priority right now, so I'll close it. If there was something I could have done better, please let me know! You can also customize me to make sure I'm working with you in the way you want. |
The
is
andis not
operators only evaluate toTrue
when the expressions on each side have the sameid
. In other words,a is b
is equivalent toid(a) == id(b)
. With few exceptions, objects and literals have unique identities and thus shouldn't generally be compared by using theis
oris not
operators.Our changes look something like this:
More reading
I have additional improvements ready for this repo! If you want to see them, leave the comment:
... and I will open a new PR right away!
🧚🤖 Powered by Pixeebot
Feedback | Community | Docs | Codemod ID: pixee:python/literal-or-new-object-identity![](https://camo.githubusercontent.com/d6d2e903741f24b9accc52e94af8efb16e0c0c5810869d5ee6faa29d94563c42/68747470733a2f2f64317a6165737361326870736d6a2e636c6f756466726f6e742e6e65742f706978656c2f76312f747261636b3f77726974654b65793d32504934336a4e6d376174597641754b37724a557a334b63643641266576656e743d445249505f5052253743696e74657230686d253246763225374364323333326131633536663439663165373337346631623664623635356365393230366231613438)