A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-December/031447.html below:

[Python-Dev] 'unhashable type' and new style classes

[Python-Dev] 'unhashable type' and new style classes [Python-Dev] 'unhashable type' and new style classesThomas Heller theller@python.net
30 Dec 2002 16:38:08 +0100
This code

  class X:
      def __cmp__(self, other):
          return 1

  c1 = X()

  d = {}
  d[c1] = None

raises a TypeError, unhashable type, since the class does
not define a __hash__ method.

This error is no longer raised when X derives from object.
Bug (or feature)?

Thomas




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4