Hello,

I'm working on coercion for interval fields (See Trac #24371) and there is one issue that I don't know how to solve elegantly:

Sage has NamedConvertMap to convert via special methods like _real_mpfi_(). When looking for a conversion map, it first tries to find a coercion map and then it checks for a default conversion map, which could be the NamedConvertMap. Now this seems to be the wrong order: after all, if a conversion exists using the _real_mpfi_() map, there is no reason to look further. Why try to find a coercion map first?

For coercion, it is slightly more complicated: ideally, one would want to use the _real_mpfi_() map if it exists, but that is wrong since the map might not define a coercion (only a conversion). So for coercion, it seems that the logic should be:

1. Check for a coercion map.

2. If coercion is possible, check for a NamedConvertMap. If so, use that instead.

3. If there is no NamedConvertMap, use the coercion map from step 1.

I feel like there should a mechanism to prefer a NamedConvertMap over other maps. Has somebody encountered this problem before for some other parent? I created Trac #24381 for this issue.


Jeroen.

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

Reply via email to