[sage-devel] Re: n(list)

2009-09-24 Thread Tim Joseph Dumol
I also agree. Mapping explicitly is a lot clearer and Pythonic. Even the functional languages, with their focus on lists, do mapping explicitly. On Thu, Sep 24, 2009 at 2:16 PM, William Stein wrote: > > On Wed, Sep 23, 2009 at 11:14 PM, Rado wrote: > > > > I am not sure if I get a vote, but I w

[sage-devel] Re: n(list)

2009-09-23 Thread William Stein
On Wed, Sep 23, 2009 at 11:14 PM, Rado wrote: > > I am not sure if I get a vote, but I wanted to say my opinion as more > of a Sage user than developer. > > Since n() is type conversion of sorts, I would expect it to behave > similar to python's int() function. Which means just give error if you

[sage-devel] Re: n(list)

2009-09-23 Thread Rado
I am not sure if I get a vote, but I wanted to say my opinion as more of a Sage user than developer. Since n() is type conversion of sorts, I would expect it to behave similar to python's int() function. Which means just give error if you pass it a list (to remind you to use map). "explicit is be

[sage-devel] Re: n(list)

2009-09-23 Thread Craig Citro
>>> The question is, do we want this case to also raise an error, or the >>> function n() to iterate over the argument when it's iterable? >> >> Why is there list comprehension in Python? I am "-1" concerning >> iteration over the argument. > > Would it be pythonic enough to have n(pi/2,pi,2*pi) r

[sage-devel] Re: n(list)

2009-09-23 Thread William Stein
On Wed, Sep 23, 2009 at 8:20 PM, Jason Grout wrote: > > Nils Bruin wrote: >> On Sep 8, 3:38 am, Jason Grout wrote: >>> Would it be pythonic enough to have n(pi/2,pi,2*pi) return a list of >>> three values?  That way we could do: >>> >>> n(*my_list) >>> >>> Note that min, max, and other functions

[sage-devel] Re: n(list)

2009-09-23 Thread Jason Grout
Nils Bruin wrote: > On Sep 8, 3:38 am, Jason Grout wrote: >> Would it be pythonic enough to have n(pi/2,pi,2*pi) return a list of >> three values? That way we could do: >> >> n(*my_list) >> >> Note that min, max, and other functions work something like this, in >> that they accept a variable num

[sage-devel] Re: n(list)

2009-09-23 Thread Robert Bradshaw
On Sep 23, 2009, at 7:57 PM, Nils Bruin wrote: > On Sep 8, 3:38 am, Jason Grout wrote: >> Would it be pythonic enough to have n(pi/2,pi,2*pi) return a list of >> three values? That way we could do: >> >> n(*my_list) >> >> Note that min, max, and other functions work something like this, in >> t

[sage-devel] Re: n(list)

2009-09-23 Thread Nils Bruin
On Sep 8, 3:38 am, Jason Grout wrote: > Would it be pythonic enough to have n(pi/2,pi,2*pi) return a list of > three values?  That way we could do: > > n(*my_list) > > Note that min, max, and other functions work something like this, in > that they accept a variable number of arguments. They do,

[sage-devel] Re: n(list)

2009-09-23 Thread Marshall Hampton
I think it would be great if n() and other functions mapped to a list. I don't see the downside, but maybe I am missing something. -Marshall On Sep 8, 5:38 am, Jason Grout wrote: > Simon King wrote: > > Hi Burcin, > > > On Sep 8, 11:21 am, Burcin Erocal wrote: > >> I would call it a bug, a si

[sage-devel] Re: n(list)

2009-09-23 Thread Robert Bradshaw
On Sep 8, 2009, at 3:38 AM, Jason Grout wrote: > Simon King wrote: >> Hi Burcin, >> >> On Sep 8, 11:21 am, Burcin Erocal wrote: >>> I would call it a bug, a side effect of trying to convert the >>> argument >>> to a complex number as a last resort. >> >> No, it is documented, at least implicit

[sage-devel] Re: n(list)

2009-09-08 Thread Jason Grout
Simon King wrote: > Hi Burcin, > > On Sep 8, 11:21 am, Burcin Erocal wrote: >> I would call it a bug, a side effect of trying to convert the argument >> to a complex number as a last resort. > > No, it is documented, at least implicitly. From the doc string of n: > INPUT: > - `

[sage-devel] Re: n(list)

2009-09-08 Thread Simon King
Hi Burcin, On Sep 8, 11:21 am, Burcin Erocal wrote: > I would call it a bug, a side effect of trying to convert the argument > to a complex number as a last resort. No, it is documented, at least implicitly. From the doc string of n: INPUT: - ``x`` - an object that has a numeri

[sage-devel] Re: n(list)

2009-09-08 Thread Jason Grout
Simon King wrote: > Hi Jason, > > On Sep 8, 10:58 am, Jason Grout wrote: >> This seems really odd to me. I expected to get back n() applied to each >> element of the list. >> >> sage: n([1,2]) >> 1.00 + 2.00*I >> >> Does anyone else find this behavior uncomfortable? > >

[sage-devel] Re: n(list)

2009-09-08 Thread Simon King
Hi Jason, On Sep 8, 10:58 am, Jason Grout wrote: > This seems really odd to me.  I expected to get back n() applied to each > element of the list. > > sage: n([1,2]) > 1.00 + 2.00*I > > Does anyone else find this behavior uncomfortable? Not I, at least. AFAIK, there are

[sage-devel] Re: n(list)

2009-09-08 Thread Burcin Erocal
On Tue, 08 Sep 2009 04:58:38 -0500 Jason Grout wrote: > > This seems really odd to me. I expected to get back n() applied to > each element of the list. > > sage: n([1,2]) > 1.00 + 2.00*I > > Does anyone else find this behavior uncomfortable? I would call it a bug, a