[pypy-svn] r79757 - pypy/trunk/lib_pypy/_ctypes

arigo at codespeak.net arigo at codespeak.net
Thu Dec 2 18:29:46 CET 2010


Author: arigo
Date: Thu Dec  2 18:29:45 2010
New Revision: 79757

Modified:
   pypy/trunk/lib_pypy/_ctypes/basics.py
Log:
* adapt the __repr__ so that we have a clue that it's actually a
  CArgObject.
* all objects with __eq__ should also have __ne__.


Modified: pypy/trunk/lib_pypy/_ctypes/basics.py
==============================================================================
--- pypy/trunk/lib_pypy/_ctypes/basics.py	(original)
+++ pypy/trunk/lib_pypy/_ctypes/basics.py	Thu Dec  2 18:29:45 2010
@@ -86,11 +86,14 @@
         self._buffer = None
 
     def __repr__(self):
-        return repr(self._obj)
+        return '<CArgObject %r>' % (self._obj,)
 
     def __eq__(self, other):
         return self._obj == other
 
+    def __ne__(self, other):
+        return self._obj != other
+
 class _CData(object):
     """ The most basic object for all ctypes types
     """



More information about the Pypy-commit mailing list