Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r2759:d04043b6e7bc
Date: 2016-09-03 23:42 +0200
http://bitbucket.org/cffi/cffi/changeset/d04043b6e7bc/

Log:    Python 3 fix

diff --git a/cffi/backend_ctypes.py b/cffi/backend_ctypes.py
--- a/cffi/backend_ctypes.py
+++ b/cffi/backend_ctypes.py
@@ -1009,6 +1009,12 @@
                         myref is not None and myref is other())
                 def __ne__(self, other):
                     return not (self == other)
+                def __hash__(self):
+                    try:
+                        return self._hash
+                    except AttributeError:
+                        self._hash = hash(self())
+                        return self._hash
             self._weakref_cache_ref = {}, MyRef
         weak_cache, MyRef = self._weakref_cache_ref
 
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to