[pypy-svn] r17623 - in pypy/dist/pypy: interpreter interpreter/test module/__builtin__ objspace objspace/std tool/pytest
tismer at codespeak.net
tismer at codespeak.net
Sat Sep 17 19:50:06 CEST 2005
Author: tismer
Date: Sat Sep 17 19:50:01 2005
New Revision: 17623
Modified:
pypy/dist/pypy/interpreter/argument.py
pypy/dist/pypy/interpreter/executioncontext.py
pypy/dist/pypy/interpreter/pyframe.py
pypy/dist/pypy/interpreter/test/test_function.py
pypy/dist/pypy/interpreter/typedef.py
pypy/dist/pypy/module/__builtin__/importing.py
pypy/dist/pypy/objspace/descroperation.py
pypy/dist/pypy/objspace/std/fake.py
pypy/dist/pypy/tool/pytest/appsupport.py
Log:
completed replacement ofspace.is_true shortcuts
Modified: pypy/dist/pypy/interpreter/argument.py
==============================================================================
--- pypy/dist/pypy/interpreter/argument.py (original)
+++ pypy/dist/pypy/interpreter/argument.py Sat Sep 17 19:50:01 2005
@@ -132,8 +132,7 @@
# self.match_signature() assumes that it can use it directly for
# a matching *arg in the callee's signature.
if self.w_stararg is not None:
- if not space.is_true(space.is_(space.type(self.w_stararg),
- space.w_tuple)):
+ if not space.is_w(space.type(self.w_stararg), space.w_tuple):
self.unpack()
try:
return self.match_signature(signature, defaults_w)
Modified: pypy/dist/pypy/interpreter/executioncontext.py
==============================================================================
--- pypy/dist/pypy/interpreter/executioncontext.py (original)
+++ pypy/dist/pypy/interpreter/executioncontext.py Sat Sep 17 19:50:01 2005
@@ -167,7 +167,7 @@
try:
try:
w_result = space.call_function(w_callback, space.wrap(frame), space.wrap(event), w_arg)
- if space.is_true(space.is_(w_result, space.w_None)):
+ if space.is_w(w_result, space.w_None):
frame.w_f_trace = None
else:
frame.w_f_trace = w_result
Modified: pypy/dist/pypy/interpreter/pyframe.py
==============================================================================
--- pypy/dist/pypy/interpreter/pyframe.py (original)
+++ pypy/dist/pypy/interpreter/pyframe.py Sat Sep 17 19:50:01 2005
@@ -286,7 +286,7 @@
return self.w_f_trace
def fset_f_trace(space, self, w_trace):
- if space.is_true(space.is_(w_trace, space.w_None)):
+ if space.is_w(w_trace, space.w_None):
self.w_f_trace = None
else:
self.w_f_trace = w_trace
Modified: pypy/dist/pypy/interpreter/test/test_function.py
==============================================================================
--- pypy/dist/pypy/interpreter/test/test_function.py (original)
+++ pypy/dist/pypy/interpreter/test/test_function.py Sat Sep 17 19:50:01 2005
@@ -267,4 +267,4 @@
# Check method returned from unbound_method.__get__()
# --- with an incompatible class
w_meth5 = meth3.descr_method_get(space.wrap('hello'), space.w_str)
- assert space.is_true(space.is_(w_meth5, w_meth3))
+ assert space.is_w(w_meth5, w_meth3)
Modified: pypy/dist/pypy/interpreter/typedef.py
==============================================================================
--- pypy/dist/pypy/interpreter/typedef.py (original)
+++ pypy/dist/pypy/interpreter/typedef.py Sat Sep 17 19:50:01 2005
@@ -202,7 +202,7 @@
"""property.__get__(obj[, type]) -> value
Read the value of the property of the given obj."""
# XXX HAAAAAAAAAAAACK (but possibly a good one)
- if w_obj == space.w_None and not space.is_true(space.is_(w_cls, space.type(space.w_None))):
+ if w_obj == space.w_None and not space.is_w(w_cls, space.type(space.w_None)):
#print property, w_obj, w_cls
return space.wrap(property)
else:
Modified: pypy/dist/pypy/module/__builtin__/importing.py
==============================================================================
--- pypy/dist/pypy/module/__builtin__/importing.py (original)
+++ pypy/dist/pypy/module/__builtin__/importing.py Sat Sep 17 19:50:01 2005
@@ -172,7 +172,7 @@
space.wrap("__import__() argument 1 must be string" + helper))
w = space.wrap
- if w_globals is not None and not space.is_true(space.is_(w_globals, space.w_None)):
+ if w_globals is not None and not space.is_w(w_globals, space.w_None):
ctxt_w_name = try_getitem(space, w_globals, w('__name__'))
ctxt_w_path = try_getitem(space, w_globals, w('__path__'))
else:
@@ -192,7 +192,7 @@
if rel_modulename is not None:
w_mod = check_sys_modules(space, w(rel_modulename))
if (w_mod is None or
- not space.is_true(space.is_(w_mod,space.w_None))):
+ not space.is_w(w_mod, space.w_None)):
w_mod = absolute_import(space, rel_modulename,
len(ctxt_name_prefix_parts),
@@ -256,7 +256,7 @@
w_modulename = w(modulename)
w_mod = check_sys_modules(space, w_modulename)
if w_mod is not None:
- if not space.is_true(space.is_(w_mod, space.w_None)):
+ if not space.is_w(w_mod, space.w_None):
return w_mod
else:
w_mod = space.sys.getmodule(modulename)
Modified: pypy/dist/pypy/objspace/descroperation.py
==============================================================================
--- pypy/dist/pypy/objspace/descroperation.py (original)
+++ pypy/dist/pypy/objspace/descroperation.py Sat Sep 17 19:50:01 2005
@@ -240,7 +240,7 @@
w_typ1 = space.type(w_obj1)
w_typ2 = space.type(w_obj2)
w_left_src, w_left_impl = space.lookup_where(w_obj1, '__pow__')
- if space.is_true(space.is_(w_typ1, w_typ2)):
+ if space.is_w(w_typ1, w_typ2):
w_right_impl = None
else:
w_right_src, w_right_impl = space.lookup_where(w_obj2, '__rpow__')
@@ -286,7 +286,7 @@
if not e.match(space, space.w_StopIteration):
raise
return space.w_False
- if space.is_true(space.eq(w_next, w_item)):
+ if space.eq_w(w_next, w_item):
return space.w_True
def hash(space, w_obj):
@@ -332,7 +332,7 @@
w_typ1 = space.type(w_obj1)
w_typ2 = space.type(w_obj2)
w_left_src, w_left_impl = space.lookup_where(w_obj1, '__coerce__')
- if space.is_true(space.is_(w_typ1, w_typ2)):
+ if space.is_w(w_typ1, w_typ2):
w_right_impl = None
else:
w_right_src, w_right_impl = space.lookup_where(w_obj2, '__coerce__')
@@ -366,7 +366,7 @@
# helpers
def _check_notimplemented(space, w_obj):
- return not space.is_true(space.is_(w_obj, space.w_NotImplemented))
+ return not space.is_w(w_obj, space.w_NotImplemented)
def _invoke_binop(space, w_impl, w_obj1, w_obj2):
if w_impl is not None:
@@ -389,7 +389,7 @@
w_left_src, w_left_impl = space.lookup_where(w_obj1, '__cmp__')
do_neg1 = False
do_neg2 = True
- if space.is_true(space.is_(w_typ1, w_typ2)):
+ if space.is_w(w_typ1, w_typ2):
w_right_impl = None
else:
w_right_src, w_right_impl = space.lookup_where(w_obj2, '__cmp__')
@@ -405,13 +405,13 @@
if w_res is not None:
return _conditional_neg(space, w_res, do_neg2)
# fall back to internal rules
- if space.is_true(space.is_(w_obj1, w_obj2)):
+ if space.is_w(w_obj1, w_obj2):
return space.wrap(0)
- if space.is_true(space.is_(w_obj1, space.w_None)):
+ if space.is_w(w_obj1, space.w_None):
return space.wrap(-1)
- if space.is_true(space.is_(w_obj2, space.w_None)):
+ if space.is_w(w_obj2, space.w_None):
return space.wrap(1)
- if space.is_true(space.is_(w_typ1, w_typ2)):
+ if space.is_w(w_typ1, w_typ2):
w_id1 = space.id(w_obj1)
w_id2 = space.id(w_obj2)
else:
@@ -430,7 +430,7 @@
w_typ1 = space.type(w_obj1)
w_typ2 = space.type(w_obj2)
w_left_src, w_left_impl = space.lookup_where(w_obj1, left)
- if space.is_true(space.is_(w_typ1, w_typ2)):
+ if space.is_w(w_typ1, w_typ2):
w_right_impl = None
else:
w_right_src, w_right_impl = space.lookup_where(w_obj2, right)
@@ -458,7 +458,7 @@
w_first = w_obj1
w_second = w_obj2
- if space.is_true(space.is_(w_typ1, w_typ2)):
+ if space.is_w(w_typ1, w_typ2):
w_right_impl = None
else:
w_right_src, w_right_impl = space.lookup_where(w_obj2, right)
Modified: pypy/dist/pypy/objspace/std/fake.py
==============================================================================
--- pypy/dist/pypy/objspace/std/fake.py (original)
+++ pypy/dist/pypy/objspace/std/fake.py Sat Sep 17 19:50:01 2005
@@ -203,7 +203,7 @@
def descr_descriptor_get(space, descr, w_obj, w_cls=None):
# XXX HAAAAAAAAAAAACK (but possibly a good one)
- if w_obj == space.w_None and not space.is_true(space.is_(w_cls, space.type(space.w_None))):
+ if w_obj == space.w_None and not space.is_w(w_cls, space.type(space.w_None)):
#print descr, w_obj, w_cls
return space.wrap(descr)
else:
Modified: pypy/dist/pypy/tool/pytest/appsupport.py
==============================================================================
--- pypy/dist/pypy/tool/pytest/appsupport.py (original)
+++ pypy/dist/pypy/tool/pytest/appsupport.py Sat Sep 17 19:50:01 2005
@@ -196,4 +196,4 @@
def eq_w(space, w_obj1, w_obj2):
""" return interp-level boolean of eq(w_obj1, w_obj2). """
- return space.is_true(space.eq(w_obj1, w_obj2))
+ return space.eq_w(w_obj1, w_obj2)
More information about the Pypy-commit
mailing list