On 2017-12-19 10:13, Simon King wrote:
Typically, _coerce_map_from_ either returns "True" or "None".
Interesting. For RIF, I implemented a specific coercion map. So in some cases, I am returning a map instead of True/False/None.
But the problem that I need to solve is that this map is strictly worse than the NamedConversionMap.
My understanding is that B._coerce_map_from_(A) returning "True" is a mathematical statement
Right, but this isn't how Sage works. There is no way to ask for mathematical properties of a Parent. There are categories, but those are much too weak: you can know that a parent is a field, but not whether all elements are real numbers for example.
I would be curious to see a _coerce_map_from_() method which actually checks for mathematical properties (as opposed to just listing a bunch of parents which coerce).
On the other hand, it *is* possible to return a map. So, of cource you could check in B._coerce_map_from_(A) whether a named conversion is available, and return it.
Yes, that was my idea. But it needs some changes to the coercion framework, which is why I created https://trac.sagemath.org/ticket/24381
But actually I wouldn't necessarily assume that a special conversion method qualifies as a coercion.
Of course, I never said that. -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
