Right. I think that you're not entirely able to trust frozenset to sort consistently. I remember being confused by the pspace example long ago. I spent some time trying to figure out exactly why I was getting different orderings; the problem goes annoyingly deep. This may have been what caused me to introduce sorted args to FiniteSet.
Comparing frozenset(args) would work fine. This would require either that we write an __eq__ method or that FiniteSet contains a single arg that is a frozenset. Both of these have issues with general SymPy convention (overloading __eq__ is a mess and frozenset is not a Basic). I am in favor of sorting args on creation. It is simple and removes a lot of problems. It has not yet been a performance issue. If an application comes along that requires very large FiniteSets then we can deal with this problem then. I am in favor of the solution in PR 1381. On Sat, Jun 23, 2012 at 10:19 AM, [email protected] < [email protected]> wrote: > I do not know much about FiniteSet and I am not commenting on the > merits of the solution. Just asking, is there a reason that FiniteSet > does not rely more on frozenset? For comparison for instance? It > should not compare .args, it should compare frozenset(args). > > And as Aaron said, if it works we can as well accept the current > solution and fix it later. > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > 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/sympy?hl=en. > > -- You received this message because you are subscribed to the Google Groups "sympy" group. 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/sympy?hl=en.
