[pypy-svn] r78669 - in pypy/branch/smalllong/pypy: module/marshal/test objspace/std

arigo at codespeak.net arigo at codespeak.net
Wed Nov 3 14:49:41 CET 2010


Author: arigo
Date: Wed Nov  3 14:49:40 2010
New Revision: 78669

Modified:
   pypy/branch/smalllong/pypy/module/marshal/test/test_marshalimpl.py
   pypy/branch/smalllong/pypy/objspace/std/model.py
Log:
Multimethods are evil.  The order of delegates must be carefully
done right.


Modified: pypy/branch/smalllong/pypy/module/marshal/test/test_marshalimpl.py
==============================================================================
--- pypy/branch/smalllong/pypy/module/marshal/test/test_marshalimpl.py	(original)
+++ pypy/branch/smalllong/pypy/module/marshal/test/test_marshalimpl.py	Wed Nov  3 14:49:40 2010
@@ -14,6 +14,7 @@
         z = 0L
         z1 = marshal.loads(marshal.dumps(z))
         assert z == z1
+        assert type(z1) is long
 
     def test_unmarshal_int64(self):
         # test that we can unmarshal 64-bit ints on 32-bit platforms
@@ -53,3 +54,10 @@
         assert z == 10000000000
         z = marshal.loads('I\x00\x1c\xf4\xab\xfd\xff\xff\xff')
         assert z == -10000000000
+
+
+class AppTestMarshalSmallLong(AppTestMarshalMore):
+    def setup_class(cls):
+        space = gettestobjspace(usemodules=('array',),
+                                **{"objspace.std.withsmalllong": True})
+        cls.space = space

Modified: pypy/branch/smalllong/pypy/objspace/std/model.py
==============================================================================
--- pypy/branch/smalllong/pypy/objspace/std/model.py	(original)
+++ pypy/branch/smalllong/pypy/objspace/std/model.py	Wed Nov  3 14:49:40 2010
@@ -190,8 +190,8 @@
                 (smalllongobject.W_SmallLongObject, smalllongobject.delegate_Int2SmallLong),
                 ]
             self.typeorder[smalllongobject.W_SmallLongObject] += [
-                (floatobject.W_FloatObject, smalllongobject.delegate_SmallLong2Float),
                 (longobject.W_LongObject, smalllongobject.delegate_SmallLong2Long),
+                (floatobject.W_FloatObject, smalllongobject.delegate_SmallLong2Float),
                 (complexobject.W_ComplexObject, smalllongobject.delegate_SmallLong2Complex),
                 ]
         self.typeorder[longobject.W_LongObject] += [



More information about the Pypy-commit mailing list