MCQs > IT & Programming > Python > In Python 3.x, what must also happen if a class defines __eq__() ?

Python MCQs

In Python 3.x, what must also happen if a class defines __eq__() ?

Answer

Correct Answer: It must also define __hash__() if its instances are immutable and need to be hashable.

Explanation:

Note: This Question is unanswered, help us to find answer for this one

Python Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Python Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it