I bisected this to

commit f95d0146f59fd9160fe867561fb6620c3a035ad1
Author: Chris Smith <smi...@gmail.com>
Date:   Wed Jun 15 22:15:17 2011 -0500

    use ordered_iter and iterable

    This reverts commit 654cb9bc6d3bdab45d45a8ec2b41df358b5aa440
    and adds a few more use cases.

The problem is that sympify(newt) checks if it is an iterable using
the iterable() function, and it thinks it is because it is indexable,
but if you do, for example, list(newt), it just hangs, because it is
trying to create [t[0], t[1], t[2], ...].

So iterable() needs to be fixed here, I think.

Aaron Meurer

On Mon, Jul 25, 2011 at 5:50 PM, Matthew Brett <matthew.br...@gmail.com> wrote:
> Hi,
>
> On my snow leopard machine:
>
> from sympy import Symbol, DeferredVector
> x = Symbol('x')
> newt = DeferredVector("t")
> res = x.subs(x, newt)
>
> results in a long hang.   On 0.7.0 and 0.6.6 it's very quick.  Ctrl-C
> on the 0.7.1 branch running the code above (as ``hanging.py``) ends
> with a traceback:
>
>  File "hanging.py", line 5, in <module>
>    res = x.subs(x, newt)
>  File 
> "/Users/mb312/.virtualenvs/sympy-0.7.1/lib/python2.6/site-packages/sympy/core/basic.py",
> line 752, in subs
>    return self._subs_old_new(old, new)
>  File 
> "/Users/mb312/.virtualenvs/sympy-0.7.1/lib/python2.6/site-packages/sympy/core/cache.py",
> line 101, in wrapper
>    func_cache_it_cache[k] = r = func(*args, **kw_args)
>  File 
> "/Users/mb312/.virtualenvs/sympy-0.7.1/lib/python2.6/site-packages/sympy/core/basic.py",
> line 760, in _subs_old_new
>    new = sympify(new)
>  File 
> "/Users/mb312/.virtualenvs/sympy-0.7.1/lib/python2.6/site-packages/sympy/core/sympify.py",
> line 134, in sympify
>    rational=rational) for x in a])
>  File 
> "/Users/mb312/.virtualenvs/sympy-0.7.1/lib/python2.6/site-packages/sympy/matrices/matrices.py",
> line 62, in __getitem__
>    return Symbol(component_name)
>  File 
> "/Users/mb312/.virtualenvs/sympy-0.7.1/lib/python2.6/site-packages/sympy/core/symbol.py",
> line 54, in __new__
>    return Symbol.__xnew_cached_(cls, name, commutative, **assumptions)
>  File 
> "/Users/mb312/.virtualenvs/sympy-0.7.1/lib/python2.6/site-packages/sympy/core/cache.py",
> line 101, in wrapper
>    func_cache_it_cache[k] = r = func(*args, **kw_args)
>  File 
> "/Users/mb312/.virtualenvs/sympy-0.7.1/lib/python2.6/site-packages/sympy/core/symbol.py",
> line 58, in __new_stage2__
>    obj = Expr.__new__(cls, **assumptions)
>  File 
> "/Users/mb312/.virtualenvs/sympy-0.7.1/lib/python2.6/site-packages/sympy/core/basic.py",
> line 83, in __new__
>    obj = object.__new__(cls)
> KeyboardInterrupt
>
> I got a little scared at the point.  Can I help with the debugging?
>
> Best,
>
> Matthew
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sympy" group.
> To post to this group, send email to sympy@googlegroups.com.
> To unsubscribe from this group, send email to 
> sympy+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/sympy?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sympy@googlegroups.com.
To unsubscribe from this group, send email to 
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to