[sage-devel] Re: coercion error: calling functions with vector inputs

2009-10-27 Thread Jason Grout
William Stein wrote: > I just want to personally thank you for your comments in this thread > (and others!). I think they were extremely helpful and clarifying, at > least to me, in understanding the issue being discussed and coming up > with several examples to... show you are in fact right.

[sage-devel] Re: coercion error: calling functions with vector inputs

2009-10-27 Thread William Stein
On Tue, Oct 27, 2009 at 9:04 PM, Nick Alexander wrote: > >> Note that we already do that for things like parametric_plot, >> derivatives, etc. > > And it's a continual pain in the ass.  Telling the difference between > a list, tuple, sequence, iterator, vector, multiple arguments, etc... > in Pyt

[sage-devel] Re: coercion error: calling functions with vector inputs

2009-10-27 Thread Jason Grout
Nick Alexander wrote: >> Note that we already do that for things like parametric_plot, >> derivatives, etc. > > And it's a continual pain in the ass. Telling the difference between > a list, tuple, sequence, iterator, vector, multiple arguments, etc... > in Python, it's just all so inconsist

[sage-devel] Re: coercion error: calling functions with vector inputs

2009-10-27 Thread Nick Alexander
> Note that we already do that for things like parametric_plot, > derivatives, etc. And it's a continual pain in the ass. Telling the difference between a list, tuple, sequence, iterator, vector, multiple arguments, etc... in Python, it's just all so inconsistent. But it seems like the fe

[sage-devel] Re: coercion error: calling functions with vector inputs

2009-10-27 Thread Jason Grout
William Stein wrote: > Before voting, may I register some concerns? > > 1. Recall your example: > > sage: t = var('t') > sage: r=vector([t,t^2]) > sage: f(x,y)=x^2+y > sage: f(r) > boom. > > If we make f(r) work (as you propose), note that the following will > still not work, and can never eve

[sage-devel] Re: coercion error: calling functions with vector inputs

2009-10-27 Thread William Stein
On Tue, Oct 27, 2009 at 5:28 PM, Jason Grout wrote: > > Nick Alexander wrote: >>> Why do you think that f, which is a function from R^2->R^1, should not >>> naturally be able to take inputs that live in R^2? >> >> I don't.  But that's not the way that Python works, and the existing >> implementat

[sage-devel] Re: coercion error: calling functions with vector inputs

2009-10-27 Thread Jason Grout
Nick Alexander wrote: >> Why do you think that f, which is a function from R^2->R^1, should not >> naturally be able to take inputs that live in R^2? > > I don't. But that's not the way that Python works, and the existing > implementation tries to make f(x, y) look like a Python function of

[sage-devel] Re: coercion error: calling functions with vector inputs

2009-10-27 Thread kcrisman
On Oct 27, 7:34 pm, Nick Alexander wrote: > > Why do you think that f, which is a function from R^2->R^1, should not > > naturally be able to take inputs that live in R^2? > > I don't.  But that's not the way that Python works, and the existing   > implementation tries to make f(x, y) look like

[sage-devel] Re: coercion error: calling functions with vector inputs

2009-10-27 Thread Nick Alexander
> Why do you think that f, which is a function from R^2->R^1, should not > naturally be able to take inputs that live in R^2? I don't. But that's not the way that Python works, and the existing implementation tries to make f(x, y) look like a Python function of two variables. I would be fin

[sage-devel] Re: coercion error: calling functions with vector inputs

2009-10-27 Thread Jason Grout
Nick Alexander wrote: > > On 27-Oct-09, at 3:17 PM, Jason Grout wrote: > >> I was looking at how to make my calc 3 calculations easier to >> understand >> by calling a multivariable function with a vector input. I ended up >> with a coercion error. I'm not that familiar with how to work with

[sage-devel] Re: coercion error: calling functions with vector inputs

2009-10-27 Thread Nick Alexander
On 27-Oct-09, at 3:17 PM, Jason Grout wrote: > > I was looking at how to make my calc 3 calculations easier to > understand > by calling a multivariable function with a vector input. I ended up > with a coercion error. I'm not that familiar with how to work with > the > coercion system. W