[sympy] checking for a lambda

2010-07-06 Thread James Pearson
On line 54 of utilities/iterables.py [0], we check to see if a variable is a lambda by checking the __str__ value, which is a bit bad. I see two other options: 1. Check to see if rv is callable. The builtin callable() was removed in Py3k, but 2to3 will replace it with the appropriate check agai

Re: [sympy] checking for a lambda

2010-07-06 Thread Ondrej Certik
On Tue, Jul 6, 2010 at 11:26 AM, James Pearson wrote: > On line 54 of utilities/iterables.py [0], we check to see if a variable is a > lambda by checking the __str__ value, which is a bit bad.  I see two other > options: > > 1.  Check to see if rv is callable.  The builtin callable() was removed i

Re: [sympy] checking for a lambda

2010-07-06 Thread Aaron S. Meurer
Or 3. Dump Python 2.4 and get rid of that function. :) Aaron Meurer On Jul 6, 2010, at 1:26 PM, James Pearson wrote: > On line 54 of utilities/iterables.py [0], we check to see if a variable is a > lambda by checking the __str__ value, which is a bit bad. I see two other > options: > > 1. C

Re: [sympy] checking for a lambda

2010-07-06 Thread Kevin Hunter
At 4:54pm -0600 Tue, 06 Jul 2010, Aaron S. Meurer wrote: > Or 3. Dump Python 2.4 and get rid of that function. :) Right on. I'm in the middle of trying to resurrect support for Python 2.4 right now for a project. It's a pain, and frankly, I think my boss is on the wrong track. Python 2.4 was la

Re: [sympy] checking for a lambda

2010-07-06 Thread Ondrej Certik
On Tue, Jul 6, 2010 at 4:07 PM, Kevin Hunter wrote: > At 4:54pm -0600 Tue, 06 Jul 2010, Aaron S. Meurer wrote: >> Or 3. Dump Python 2.4 and get rid of that function. :) > > Right on. > > I'm in the middle of trying to resurrect support for Python 2.4 right > now for a project.  It's a pain, and fr

Re: [sympy] checking for a lambda

2010-07-06 Thread James Pearson
On Tue, Jul 6, 2010 at 4:07 PM, Kevin Hunter wrote: > At 4:54pm -0600 Tue, 06 Jul 2010, Aaron S. Meurer wrote: > > Or 3. Dump Python 2.4 and get rid of that function. :) > > Right on. > > I'm in the middle of trying to resurrect support for Python 2.4 right > now for a project. It's a pain, and

Re: [sympy] checking for a lambda

2010-07-06 Thread Aaron S. Meurer
See also this (somewhat old) thread: http://groups.google.com/group/sympy/browse_thread/thread/b0103e9ce1301440# As far as triviality of the support, I guess we could keep rewriting the Python 2.5+ functions in iterables.py (so far we have four), but as soon as we get the assumptions system to