[pypy-svn] r37712 - pypy/dist/pypy/objspace/std

cfbolz at codespeak.net cfbolz at codespeak.net
Thu Feb 1 11:13:27 CET 2007


Author: cfbolz
Date: Thu Feb  1 11:13:12 2007
New Revision: 37712

Modified:
   pypy/dist/pypy/objspace/std/floatobject.py
   pypy/dist/pypy/objspace/std/intobject.py
   pypy/dist/pypy/objspace/std/longobject.py
Log:
remove strange and quite old comments and commented out code


Modified: pypy/dist/pypy/objspace/std/floatobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/floatobject.py	(original)
+++ pypy/dist/pypy/objspace/std/floatobject.py	Thu Feb  1 11:13:12 2007
@@ -4,12 +4,6 @@
 from pypy.objspace.std.longobject import W_LongObject
 from pypy.rlib.rarithmetic import ovfcheck_float_to_int, intmask, isinf
 
-##############################################################
-# for the time being, all calls that are made to some external
-# libraries in the floatobject.c, calls are made into the 
-# python math library
-##############################################################
-
 import math
 from pypy.objspace.std.intobject import W_IntObject
 
@@ -280,11 +274,6 @@
 
 truediv__Float_Float = div__Float_Float
 
-# avoid space.getitem for a basic operation
-##def floordiv__Float_Float(space, w_float1, w_float2):
-##    w_t = divmod__Float_Float(space, w_float1, w_float2)
-##    return space.getitem(w_t, space.wrap(0))
-
 def floordiv__Float_Float(space, w_float1, w_float2):
     w_div, w_mod = _divmod_w(space, w_float1, w_float2)
     return w_div
@@ -397,17 +386,6 @@
 def nonzero__Float(space, w_float):
     return space.newbool(w_float.floatval != 0.0)
 
-######## coercion must be done later
-later = """
-def float_coerce(space, w_float):
-    if w_float.__class__ == W_FloatObject:
-        return w_float
-    else:
-        return W_FloatObject(w_float.floatval)
-
-StdObjSpace.coerce.register(float_coerce, W_FloatObject)
-"""
-
 def getnewargs__Float(space, w_float):
     return space.newtuple([W_FloatObject(w_float.floatval)])
 

Modified: pypy/dist/pypy/objspace/std/intobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/intobject.py	(original)
+++ pypy/dist/pypy/objspace/std/intobject.py	Thu Feb  1 11:13:12 2007
@@ -28,14 +28,6 @@
 registerimplementation(W_IntObject)
 
 
-"""
-XXX not implemented:
-free list
-FromString
-FromUnicode
-print
-"""
-
 def int_w__Int(space, w_int1):
     return int(w_int1.intval)
 
@@ -324,19 +316,6 @@
     res = a | b
     return wrapint(space, res)
 
-# coerce is not wanted
-##
-##static int
-##coerce__Int(PyObject **pv, PyObject **pw)
-##{
-##    if (PyInt_Check(*pw)) {
-##        Py_INCREF(*pv);
-##        Py_INCREF(*pw);
-##        return 0;
-##    }
-##    return 1; /* Can't do it */
-##}
-
 # int__Int is supposed to do nothing, unless it has
 # a derived integer object, where it should return
 # an exact one.
@@ -346,14 +325,6 @@
     a = w_int1.intval
     return wrapint(space, a)
 
-"""
-# Not registered
-def long__Int(space, w_int1):
-    a = w_int1.intval
-    x = long(a)  ## XXX should this really be done so?
-    return space.newlong(x)
-"""
-
 def float__Int(space, w_int1):
     a = w_int1.intval
     x = float(a)

Modified: pypy/dist/pypy/objspace/std/longobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/longobject.py	(original)
+++ pypy/dist/pypy/objspace/std/longobject.py	Thu Feb  1 11:13:12 2007
@@ -205,7 +205,7 @@
 def nonzero__Long(space, w_long):
     return space.newbool(w_long.num.tobool())
 
-def invert__Long(space, w_long): #Implement ~x as -(x + 1)
+def invert__Long(space, w_long):
     return W_LongObject(w_long.num.invert())
 
 def lshift__Long_Long(space, w_long1, w_long2):



More information about the Pypy-commit mailing list