[pypy-dev] base class hierarchy for string objects breaks translation

Amaury Forgeot d'Arc amauryfa at gmail.com
Wed Mar 14 19:00:41 CET 2012


2012/3/14  <wlavrijsen at lbl.gov>:
> [translation:ERROR]  TypeError': issubclass() arg 1 must be a class
> [translation:ERROR]     .. v2364 = simple_call((builtin_function_or_method
> isinstance), r_0, ((<type 'int'>, <type 'long'>)))
> [translation:ERROR]     .. '(pypy.rlib.rarithmetic:139)is_valid_int'
> [translation:ERROR] Processing block:
> [translation:ERROR]  block at -1 is a <class
> 'pypy.objspace.flow.flowcontext.SpamBlock'>
> [translation:ERROR]  in (pypy.rlib.rarithmetic:139)is_valid_int
>
> [translation:ERROR]  containing the following operations:
> [translation:ERROR]        v2364 = simple_call((builtin_function_or_method
> isinstance), r_0, ((<type 'int'>, <type 'long'>)))
> [translation:ERROR]        v2365 = is_true(v2364)
> [translation:ERROR]  --end--

Bah, isinstance(x, (int,long)) is not RPython.
  isinstance(x, int) or isinstance(x, long)
should be used instead.


-- 
Amaury Forgeot d'Arc


More information about the pypy-dev mailing list