LearnFrenzy
Sign in Take a free test

OOP in Python · OOP in Python MCQ · Question 6

== without __eq__ Answer, explanation & discussion

  • MCQ
  • Medium
  • 0 comments
  • Answer explained
  • Moderated community
Question 6 Back to Exercise

A class has no __eq__. What does A(1) == A(1) compare?

  • A Identity – so it is False for two separate objects Correct
  • B All attributes
  • C The class names
  • D The memory sizes
Correct Answer: Option A

The default __eq__ inherited from object behaves like is.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links