Author: Maciej Fijalkowski <[email protected]>
Branch:
Changeset: r64179:ee0e0b487513
Date: 2013-05-15 18:55 +0200
http://bitbucket.org/pypy/pypy/changeset/ee0e0b487513/
Log: An attempt to fix test_zjit
diff --git a/pypy/module/micronumpy/compile.py
b/pypy/module/micronumpy/compile.py
--- a/pypy/module/micronumpy/compile.py
+++ b/pypy/module/micronumpy/compile.py
@@ -14,6 +14,7 @@
from pypy.module.micronumpy.interp_arrayops import where
from pypy.module.micronumpy import interp_ufuncs
from rpython.rlib.objectmodel import specialize, instantiate
+from rpython.rlib.nonconst import NonConstant
class BogusBytecode(Exception):
@@ -40,6 +41,10 @@
TWO_ARG_FUNCTIONS = ["dot", 'take']
THREE_ARG_FUNCTIONS = ['where']
+class W_TypeObject(W_Root):
+ def __init__(self, name):
+ self.name = name
+
class FakeSpace(object):
w_ValueError = "ValueError"
w_TypeError = "TypeError"
@@ -48,17 +53,17 @@
w_NotImplementedError = "NotImplementedError"
w_None = None
- w_bool = "bool"
- w_int = "int"
- w_float = "float"
- w_list = "list"
- w_long = "long"
- w_tuple = 'tuple'
- w_slice = "slice"
- w_str = "str"
- w_unicode = "unicode"
- w_complex = "complex"
- w_dict = "dict"
+ w_bool = W_TypeObject("bool")
+ w_int = W_TypeObject("int")
+ w_float = W_TypeObject("float")
+ w_list = W_TypeObject("list")
+ w_long = W_TypeObject("long")
+ w_tuple = W_TypeObject('tuple')
+ w_slice = W_TypeObject("slice")
+ w_str = W_TypeObject("str")
+ w_unicode = W_TypeObject("unicode")
+ w_complex = W_TypeObject("complex")
+ w_dict = W_TypeObject("dict")
def __init__(self):
"""NOT_RPYTHON"""
@@ -73,6 +78,13 @@
def issequence_w(self, w_obj):
return isinstance(w_obj, ListObject) or isinstance(w_obj, W_NDimArray)
+ def len(self, w_obj):
+ assert isinstance(w_obj, ListObject)
+ return self.wrap(len(w_obj.items))
+
+ def getattr(self, w_obj, w_attr):
+ return StringObject(NonConstant('foo'))
+
def isinstance_w(self, w_obj, w_tp):
return w_obj.tp == w_tp
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit