Commits

Armin Rigo committed b0d7d2f

Multimethods are evil. The order of delegates must be carefully
done right.

Comments (0)

Files changed (2)

pypy/module/marshal/test/test_marshalimpl.py

         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
         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

pypy/objspace/std/model.py

                 (smalllongobject.W_SmallLongObject, smalllongobject.delegate_Int2SmallLong),
                 ]
             self.typeorder[smalllongobject.W_SmallLongObject] += [
+                (longobject.W_LongObject, smalllongobject.delegate_SmallLong2Long),
                 (floatobject.W_FloatObject, smalllongobject.delegate_SmallLong2Float),
-                (longobject.W_LongObject, smalllongobject.delegate_SmallLong2Long),
                 (complexobject.W_ComplexObject, smalllongobject.delegate_SmallLong2Complex),
                 ]
         self.typeorder[longobject.W_LongObject] += [