[pypy-svn] r62158 - in pypy/trunk/pypy: interpreter/test objspace/std objspace/std/test
cfbolz at codespeak.net
cfbolz at codespeak.net
Wed Feb 25 17:28:00 CET 2009
Author: cfbolz
Date: Wed Feb 25 17:27:59 2009
New Revision: 62158
Modified:
pypy/trunk/pypy/interpreter/test/test_exceptcomp.py
pypy/trunk/pypy/objspace/std/intobject.py
pypy/trunk/pypy/objspace/std/stdtypedef.py
pypy/trunk/pypy/objspace/std/test/test_intobject.py
pypy/trunk/pypy/objspace/std/test/test_stringobject.py
Log:
Clean up some commented out and very old code. Kill a completely outdated
comment.
Modified: pypy/trunk/pypy/interpreter/test/test_exceptcomp.py
==============================================================================
--- pypy/trunk/pypy/interpreter/test/test_exceptcomp.py (original)
+++ pypy/trunk/pypy/interpreter/test/test_exceptcomp.py Wed Feb 25 17:27:59 2009
@@ -5,32 +5,6 @@
class AppTestExceptionComp:
-### XXX - String exceptions depreciated?
-## def test_string(self):
-## string = "string"
-## try:
-## raise string
-## except string:
-## pass
-## except:
-## self.fail("Identical string exceptions do not match.")
-##
-## def test_stringfail(self):
-## string1 = "string1"
-## string1_ = "string" + "1"
-## assert string1 is not string1_
-## try:
-## raise string1
-## except "string2":
-## self.fail("Different string exceptions match.")
-## except string1_:
-## self.fail("Non Identical string exceptions match.")
-## except string1:
-## pass
-## except:
-## self.fail("Unknown value for variable raise.")
-
-
def test_exception(self):
try:
raise TypeError, "nothing"
Modified: pypy/trunk/pypy/objspace/std/intobject.py
==============================================================================
--- pypy/trunk/pypy/objspace/std/intobject.py (original)
+++ pypy/trunk/pypy/objspace/std/intobject.py Wed Feb 25 17:27:59 2009
@@ -247,20 +247,8 @@
if b >= LONG_BIT:
raise FailedToImplement(space.w_OverflowError,
space.wrap("integer left shift"))
- ##
- ## XXX please! have a look into pyport.h and see how to implement
- ## the overflow checking, using macro Py_ARITHMETIC_RIGHT_SHIFT
- ## we *assume* that the overflow checking is done correctly
- ## in the code generator, which is not trivial!
-
- ## XXX also note that Python 2.3 returns a long and never raises
- ## OverflowError.
try:
c = ovfcheck_lshift(a, b)
- ## the test in C code is
- ## if (a != Py_ARITHMETIC_RIGHT_SHIFT(long, c, b)) {
- ## if (PyErr_Warn(PyExc_FutureWarning,
- # and so on
except OverflowError:
raise FailedToImplement(space.w_OverflowError,
space.wrap("integer left shift"))
@@ -280,8 +268,6 @@
else:
a = 0
else:
- ## please look into pyport.h, how >> should be implemented!
- ## a = Py_ARITHMETIC_RIGHT_SHIFT(long, a, b);
a = a >> b
return wrapint(space, a)
Modified: pypy/trunk/pypy/objspace/std/stdtypedef.py
==============================================================================
--- pypy/trunk/pypy/objspace/std/stdtypedef.py (original)
+++ pypy/trunk/pypy/objspace/std/stdtypedef.py Wed Feb 25 17:27:59 2009
@@ -110,46 +110,6 @@
result.append(value)
return result
-##def make_frameclass_for_arity(arity, varargs, keywords, isspecial):
-## argnames = []
-## for i in range(arity):
-## argnames.append('arg%dof%d'%(i+1, arity))
-## if varargs:
-## argnames.append('var_args')
-## if keywords:
-## argnames.append('kw_args')
-## self_args_assigning = []
-## for i in range(len(argnames)):
-## self_args_assigning.append(' self.%s = args[%i]'%(argnames[i], i))
-## self_args_assigning = "\n".join(self_args_assigning)
-## self_args = ", ".join(['self.'+ a for a in argnames])
-## name = 'MmFrameOfArity%d'%arity
-## if varargs:
-## name += "Var"
-## if keywords:
-## name += "KW"
-## if isspecial:
-## name = "Special" + name
-## d = locals()
-## template = mmtemplate
-## if isspecial:
-## template += specialmmruntemplate
-## else:
-## template += mmruntemplate
-### print template%d
-## exec template%d in globals(), d
-## return d[name]
-##
-##_frameclass_for_arity_cache = {}
-##def frameclass_for_arity(arity, varargs, keywords, isspecial):
-## try:
-## return _frameclass_for_arity_cache[(arity, varargs, keywords, isspecial)]
-## except KeyError:
-## r = _frameclass_for_arity_cache[(arity, varargs, keywords, isspecial)] = \
-## make_frameclass_for_arity(arity, varargs, keywords, isspecial)
-## return r
-
-
def sliced_typeorders(typeorder, multimethod, typedef, i, local=False):
"""NOT_RPYTHON"""
list_of_typeorders = [typeorder] * multimethod.arity
Modified: pypy/trunk/pypy/objspace/std/test/test_intobject.py
==============================================================================
--- pypy/trunk/pypy/objspace/std/test/test_intobject.py (original)
+++ pypy/trunk/pypy/objspace/std/test/test_intobject.py Wed Feb 25 17:27:59 2009
@@ -271,18 +271,6 @@
result = iobj.int__Int(self.space, f1)
assert result == f1
-## def test_long(self):
-## x = 1
-## f1 = iobj.W_IntObject(x)
-## result = iobj.int_long(self.space, f1)
-## self.assertEquals(self.space.unwrap(result), long(x))
-
-## def test_float(self):
-## x = 1
-## f1 = iobj.W_IntObject(x)
-## result = iobj.int_float(self.space, f1)
-## self.assertEquals(self.space.unwrap(result), float(x))
-
def test_oct(self):
x = 012345
f1 = iobj.W_IntObject(x)
Modified: pypy/trunk/pypy/objspace/std/test/test_stringobject.py
==============================================================================
--- pypy/trunk/pypy/objspace/std/test/test_stringobject.py (original)
+++ pypy/trunk/pypy/objspace/std/test/test_stringobject.py Wed Feb 25 17:27:59 2009
@@ -8,34 +8,6 @@
def teardown_method(self, method):
pass
-## def test_order_rich(self):
-## space = self.space
-## def w(txt):
-## return W_StringObject(space, txt)
-## strs = ['ala', 'bla', 'ala', 'alaaa', '', 'b']
-## ops = [ 'EQ', 'LT', 'GT', 'NE', 'LE', 'GE' ]
-
-## while strs[1:]:
-## str1 = strs.pop()
-## for op in ops:
-## #original python function
-## orf = getattr(str1, '__%s__' % op.lower())
-## pypyconst = getattr(stringobject, op)
-## for str2 in strs:
-## if orf(str2):
-## self.failUnless_w(
-## string_richcompare(space,
-## w(str1),
-## w(str2),
-## pypyconst))
-## else:
-## self.failIf_w(
-## string_richcompare(space,
-## w(str1),
-## w(str2),
-## pypyconst))
-
-
def test_str_w(self):
assert self.space.str_w(self.space.wrap("foo")) == "foo"
More information about the Pypy-commit
mailing list