Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

249
Views
Is object() == object() guaranteed to be False?

Suppose I create two instances of class object. Are these two instances guaranteed to be not equal to each other? In other words, is object() == object() guaranteed to be False, or is it implementation-dependent?

I understand that object() is object() is guaranteed to be False, but here I am asking about object() == object().

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Yes it is guaranteed that object() == object() is False because it is documented that "by default, object implements __eq__() by using is".

over 4 years ago · Santiago Trujillo Report

0

Each Python 3.x release is intended to be backward-compatible with previous 3.x releases. As it's the base class, changing the comparison behavior of object would break this backward compatibility promise. So I think you can rely on it, but if we knew what you're trying to do that requires this invariant, we could probably give better advice.

You can always use assert to make sure it continues to be true.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!