On Thursday, November 5, 2015 at 7:22:10 AM UTC-8, Travis Scrimshaw wrote: > > So I'm somewhat inclined to use EqualityById and let the pickling be > broken (and redefining _test_pickling to do nothing (i.e., passes) with a > docstring warning that it is intentionally broken). I'm starting to become > really convinced that this is the way to go. >
I completely agree. There's really no problem if calling "TwoSphere()" two times yields non-equal two-spheres: You've just created two manifolds that are homeomorphic, but since they are different manifolds, there is not a canonical homeomorphism between them, so treating them as distinct objects is quite justified. If you want to keep talking about *the same* manifold. The fact that in sage QQ['x','y'] and QQ['x','y'] gives back equal polynomial rings is because the correspondence in naming of the generators suggests a distinguished isomorphism between the two polynomial rings (well, that's a mathematical justification. It's mainly convenient). Sage goes a step further by ensuring that the rings are *identical*, which has turned out to have pros and cons. Clearly, for a manifold there is not a small set of parameters given at construction that, when in agreement, suggest a distinguished isomorphism. So I think the basis for any "CachedRepresentation" is rather weak (and will lead to code the behaviour of which is hard to predict). Incidentally, I guess your "charts" need to be immutable if you use then as keys, but do your manifolds have to be? EqualityById objects have relatively little use for being hashable. Certainly as dictionary keys they are hardly useful: D[eq_by_id_obj] could always be spelled as eq_by_id_obj.D , since you have to have the exact object in hand to look it up in a dictionary anyway. If you allow for atlasses to be refined and updates, it would be more natural to leave manifolds mutable and hence unhashable (because clearly you're mutating them). By making manifolds hashable you're entering into a contract that doesn't sound so natural (although EqualityById guarantees you'll keep your contract). -- 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 http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.