Commits

Philip Jenvey committed c393052

prefer decorators

Comments (0)

Files changed (1)

pypy/objspace/std/longobject.py

 
 import functools
 
+from rpython.rlib.objectmodel import specialize
 from rpython.rlib.rbigint import rbigint
 from rpython.rlib.rstring import ParseStringError
 from rpython.tool.sourcetools import func_renamer, func_with_new_name
     def __init__(self, num):
         self.num = num # instance of rbigint
 
+    @staticmethod
     def fromint(space, intval):
         return W_LongObject(rbigint.fromint(intval))
-    fromint = staticmethod(fromint)
 
     def longval(self):
         return self.num.tolong()
     def toint(self):
         return self.num.toint()
 
+    @staticmethod
     def fromfloat(space, f):
         return newlong(space, rbigint.fromfloat(f))
-    fromfloat = staticmethod(fromfloat)
 
+    @staticmethod
     def fromlong(l):
         return W_LongObject(rbigint.fromlong(l))
-    fromlong = staticmethod(fromlong)
 
+    @staticmethod
+    @specialize.argtype(0)
     def fromrarith_int(i):
         return W_LongObject(rbigint.fromrarith_int(i))
-    fromrarith_int._annspecialcase_ = "specialize:argtype(0)"
-    fromrarith_int = staticmethod(fromrarith_int)
 
     def int_w(self, space):
         try: