[Python-checkins] cpython (2.7): Define a __hash__ to quiet down a -3 warning

donald.stufft python-checkins at python.org
Tue Nov 11 18:33:24 CET 2014


https://hg.python.org/cpython/rev/e4c32152b25b
changeset:   93475:e4c32152b25b
branch:      2.7
parent:      93472:ed696903ad48
user:        Donald Stufft <donald at stufft.io>
date:        Tue Nov 11 12:32:57 2014 -0500
summary:
  Define a __hash__ to quiet down a -3 warning

files:
  Lib/test/_mock_backport.py |  5 +++++
  1 files changed, 5 insertions(+), 0 deletions(-)


diff --git a/Lib/test/_mock_backport.py b/Lib/test/_mock_backport.py
--- a/Lib/test/_mock_backport.py
+++ b/Lib/test/_mock_backport.py
@@ -1873,6 +1873,8 @@
 class _ANY(object):
     "A helper object that compares equal to everything."
 
+    __hash__ = object.__hash__
+
     def __eq__(self, other):
         return True
 
@@ -1923,6 +1925,9 @@
 
     If the _Call has no name then it will match any name.
     """
+
+    __hash__ = object.__hash__
+
     def __new__(cls, value=(), name=None, parent=None, two=False,
                 from_kall=True):
         name = ''

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list