Hi Martin,

I am frustrated with the following and would like to fix it: 
>

> Is "Set" supposed to be slow?  Replacing "Set" with "set" in 
> "SetPartition.__init__" is a huge improvement, we go down to about 5.5 ms 
> per loop, but "Set" has bitten me performance (
> https://trac.sagemath.org/ticket/23877) and featurewise (
> https://trac.sagemath.org/ticket/23324) already so often, that I'd rather 
> get rid of it altogether.  Is there any point at all in having "Set"?
>

I can certainly hear your frustration, but these kinds of comments make me 
far less willing to help you as it makes me feel like it is flamebait and 
you are too narrowly focused on your issues.

Yes, there are a number of reasons to have Set. It allows you to work 
within Sage's Parent/Element framework, the nice output representations, it 
is hashable when the input objects are hashable, and the code can be easier 
to understand (e.g., you cannot do X + Y with (frozen)sets and it doesn't 
have a *method* to get subsets). However, as Sébastien said, it is better 
to use frozenset internally, but there is a caveat, this only works 
whenever you want to assume your objects are hashable. Now for 
SetPartition, I think that is a reasonable assumption and should be 
changed. However, it might require a fairly substantial overhaul of that 
code and a number of other places where that code is used to build 
iterators. +1 for you making such improvements to SetPartitions.

Best,
Travis


-- 
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