.. _eq-without-hash:

eq-without-hash / W1641
=======================

**Message emitted:**

Implementing __eq__ without also implementing __hash__

**Description:**

*Used when a class implements __eq__ but not __hash__. Objects get None as their default __hash__ implementation if they also implement __eq__.*


**Correct code:**

.. literalinclude:: /data/messages/e/eq-without-hash/good.py
   :language: python

**Additional details:**

You can help us make the doc better `by contributing <https://github.com/PyCQA/pylint/issues/5953>`_ !



.. note::
  This message is emitted by the optional :ref:`'eq-without-hash'<pylint.extensions.eq_without_hash>` checker which requires the ``pylint.extensions.eq_without_hash``
  plugin to be loaded.

Created by the `eq-without-hash <https://github.com/PyCQA/pylint/blob/main/pylint/extensions/eq_without_hash.py>`__ checker.