On Sat, Jan 30, 2010 at 10:23 PM, Dima Pasechnik <dimp...@gmail.com> wrote:
> On Jan 30, 1:35 pm, John H Palmieri <jhpalmier...@gmail.com> wrote:
>> On Jan 29, 8:46 pm, Dima Pasechnik <dimp...@gmail.com> wrote:
>>
>> > it shows, by the way, that idea to use set() (or Set()) to remedy
>> > differences in docstrings with
>> > the output of randomised procedures, discussed
>> > here:http://groups.google.com/group/sage-devel/browse_thread/thread/1f688f...
>> > does not really fly.
>>
>> How does it show this?  If your expected output is a list [x,y] or
>> [y,x], but you can't tell which, then
>>
>> sage: set(OUTPUT) == set([x,y])
>> True
>> sage: x in OUTPUT
>> True
>> sage: y in OUTPUT
>> True
>> sage: len(OUTPUT)
>> 2
>>
>> I see that you can't do
>>
>> sage: OUTPUT
>> set([x,y])
>>
>> but why not the other options?  I feel like I'm missing something...
>>
>
> one cannot write things like set([x,y]) in EXAMPLES::
> it needs to be explicitly expanded.

EXAMPLES::

This will always work, but is not desirable, since output is not checked::

    sage: set([x,y])    # randoma

This always works:

    sage: v = set([x,y])
    sage: sorted(list(v))
    [x, y]


> Further, imagine you only know that the function must output
> p*a*q, for
> a=[[1,...,5],
>    [6,...10],
>    [11,...,15]]
>
> and p and q  unknown permutation matrices of appropriate sizes.
> So you need to chase 5!.3!=720 cases, and take the right one.
> This is easy to do, but to write out the set of 720 matrices in the
> EXAMPLES::
> explicitly makes little sense.
> That's what TESTS:: is for, AFAIK.

Please do not put 720 matrices anywhere in the Sage docstrings.  Ick.

William

>
> Dmitrii
>
> --
> To post to this group, send an email to sage-devel@googlegroups.com
> To unsubscribe from this group, send an email to 
> sage-devel+unsubscr...@googlegroups.com
> For more options, visit this group at 
> http://groups.google.com/group/sage-devel
> URL: http://www.sagemath.org
>



-- 
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to