Hi,

On Thu, Oct 09, 2008 at 02:19:35AM +0200, Ondrej Certik wrote:
>     if hasattr(i, "__iter__"):
> RuntimeError: internal error: <RuntimeError object at 0xb03b60>

This occurs because our 'str' type has an '__iter__' special method.  It
turns out that CPython's does not.  I suppose we could remove our
__iter__, but I would rather suggest that sympy's code is fragile there:
as soon as someone realizes that in CPython it is possible to speed up
iteration over strings by creating a stringiterator type, then CPython
will grow a 'str.__iter__' as well, and the same infinite recursion will
occur in sympy...

A cleaner way to say "is x iterable?" would be to try to call iter(x)
and see if it raises TypeError or not.


A bientot,

Armin
_______________________________________________
[email protected]
http://codespeak.net/mailman/listinfo/pypy-dev

Reply via email to