On Thursday, January 2, 2014 2:42:13 AM UTC-8, Peter Bruin wrote: > > Except that currently (if A is the codomain) A.__call__() looks for a > conversion and calls it, where the default conversion consists of calling > A._element_constructor_(), so just letting the conversion f be the callable > A itself instead would create a circularity (A(x) = A.__call__(x) = f(x) = > A(x) = ...). To implement your proposal, one could return "lambda x: > return A._element_constructor_(x)" as the conversion. > No, it could simply be (a weak reference to) A._element_constructor_, (yes, bound methods turn out to allow weak references!). A benefit would be that we do not need superfluous wrappers.
This brings up another point:I think the mail reason for reifying a "conversion" in the first place is because we want them cached for efficiency reasons. If they're going to be _element_constructor_ all the time anyway, I'm not so sure we need to cache them. -- 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/groups/opt_out.