On Sat, Dec 07, 2013 at 06:35:31AM -0800, Christopher Smith wrote:
>    In sympy/core/add.py:
> 
>  > @@ -183,6 +183,9 @@ def flatten(cls, seq):
>  >                  terms[s] += c
> 
>    But line 133 already handled a bare nan

Yes.  But that's long befor c is introduced.

> and Mul already returns nan if a factor is nan.

How about Pow?  (Yet another place where c was inroduced.)

>    So I don't think that we will ever encounter a c that is
>    nan at this point in the code. That's why I am suggesting the movement of
>    the test.

May be, but I'm not sure for now.  Anyway, I'll move nan case up.