In my opinion, `Set` should not be used in library code.  It is slow, 
unnecessary, and can hide subtle bugs when the underlying object is not 
hashable. (https://trac.sagemath.org/ticket/23324)

For the concrete issue at hand, the use of `Set` could be easily removed in 
all methods except `SetPartition.base_set` and 
`SetPartitions_set.base_set`, because in these two cases calling code might 
expect a `Set`.

Should we do this?

I should add that this (probably) doesn't solve the underlying issue, and 
moreover may affect a lot of doctests, because it might change the ordering 
of the parts returned in _repr_.

Martin


Am Samstag, 20. April 2019 04:14:53 UTC+2 schrieb Nils Bruin:
>
> On Friday, April 19, 2019 at 5:25:13 PM UTC-7, John H Palmieri wrote:
>>
>> What does
>>
>> sage: C
>> Set partitions of {'a', 'c', 'b'}
>>
>>
>> reveal? Is it helpful, or can it be omitted?
>>
>> Adding to that: perhaps it reveals something for the documentation 
> reader. But in that case the output doesn't need to be tested. The test 
> comes later by showing that further methods on C have the desired effect. 
> In that case,
>
> sage: C # random print order
> Set partitions of {'a', 'c', 'b'}
> sage: C.cardinality()
> 5
>
> does the trick AND we keep the output displayed for documentation purposes.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to