Re: [Numpy-discussion] Unexpected attribute error

2009-11-18 Thread Charles R Harris
On Wed, Nov 18, 2009 at 10:17 AM, James Bergstra wrote: > On Tue, Nov 17, 2009 at 9:53 PM, Robert Kern > wrote: > > On Tue, Nov 17, 2009 at 20:48, James Bergstra > wrote: > >> Is it by design that "numpy.sqrt(None)" raises an "AttributeError: > sqrt"? > > > > Yes. numpy.sqrt() is a ufunc. Ufunc

Re: [Numpy-discussion] Unexpected attribute error

2009-11-18 Thread James Bergstra
On Tue, Nov 17, 2009 at 9:53 PM, Robert Kern wrote: > On Tue, Nov 17, 2009 at 20:48, James Bergstra > wrote: >> Is it by design that  "numpy.sqrt(None)" raises an "AttributeError: sqrt"? > > Yes. numpy.sqrt() is a ufunc. Ufuncs take their arguments and try to > convert them to numpy arrays; the

Re: [Numpy-discussion] Unexpected attribute error

2009-11-17 Thread Robert Kern
On Tue, Nov 17, 2009 at 20:48, James Bergstra wrote: > Is it by design that  "numpy.sqrt(None)" raises an "AttributeError: sqrt"? Yes. numpy.sqrt() is a ufunc. Ufuncs take their arguments and try to convert them to numpy arrays; the manual equivalent is numpy.asarray(None). In this case, you get

[Numpy-discussion] Unexpected attribute error

2009-11-17 Thread James Bergstra
Is it by design that  "numpy.sqrt(None)" raises an "AttributeError: sqrt"? This was confusing because there was an attribute lookup of 'sqrt' in numpy right there in the expression I typed, but that was not the attribute that python was complaining about.  I presume that numpy.sqrt didn't know wha