On Sat, Nov 13, 2010 at 11:05 AM, Aaron S. Meurer <[email protected]> wrote: > This is exactly the same thing that I mentioned before. Iterating through a > set has absolutely no guaranteed order, even if you do it two times with the > same set in the same session. This is not even the same as something > producing different results on different machines; that sort of thing is > easily solved by testing one of two results. For one thing, in this case, it > can be more than two possible results. For example, if you iterate through > set([x, y, z]), it could happen in one of six possible ways. > > People have been advocating the use of sets for a lot of things lately, but I > think that we have to remember that this can happen with them. Even though > these things are technically mathematically unordered, it's important for an > algorithm for things to be in a deterministic order, even if that order > itself doesn't matter. > > So I think we would really be better of using lists for these computations, > with some canonical ordering (which can be any arbitrary thing), at least in > the intermediate computations (returning a set is another story, I guess).
Or made the algorithm not depending on the order. Either way is fine, but it has to be robust. Ondrej -- 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.
