On Thu, Sep 4, 2008 at 11:19 PM, Harald Schilly
<[EMAIL PROTECTED]> wrote:
>
>
>
> On Sep 4, 10:54 pm, Jason Grout <[EMAIL PROTECTED]> wrote:
>> Inhttp://trac.sagemath.org/sage_trac/ticket/3704, the diagonal matrix
>> constructor is modified (and simplified/enhanced) to let someone do:
>>
>> sage: diagonal_matrix(1,2,3)
>
> hi, i didn't read the patch and don't want to comment much, but just
> want to point out that the (.,.,.) arguments in python are limited to
> 255 - at least i think so. this is a nice syntax, but problematic if
I don't think so.
def t(*args):
print len(args), args[0], args[-1]
t(1, 2, 3)
t(*range(10**6))
The above prints:
3 1 3
1000000 0 999999
There doesn't seem to be any limit on the number of arguments.
Ondrej
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
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://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---