On Jan 16, 2008 11:31 AM, William Stein <[EMAIL PROTECTED]> wrote:
>
> On Jan 16, 2008 9:26 AM, Robert Bradshaw <[EMAIL PROTECTED]> wrote:
> >
> > There is no way in python to detect how many arguments a function
> > result will be assigned to, and I'm not a fan of magma's way of doing
> > it. WIth variable length tuples one has to check the length of a
> > tuple before unpacking it.
>
> I'll just come out and say it -- It's a _terrible_ design in Magma.  I also
> found it bad when I used it.  I once overheard somebody at IHP in Paris
> talking with John Cannon about Magma and learning of variable numbers
> of return arguments (as in Magma), and just being incredulous that they
> could have actually implemented something like that.     And personally
> it makes the computer scientist in me cringe.
>
> Python's solution to the multiple-return-values problem, with
> automatic tuple unpacking, is much more elegant.

And it's worth noting that for py3k they added the very nice extension:

>>> a, *b, c = range(5)
>>> a
0
>>> c
4
>>> b
[1, 2, 3]

Details here:

http://www.python.org/dev/peps/pep-3132/

Cheers,

f

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to