What about my example:  constant polynomials to elements of the base
ring.

In this case it seems *much more natural* to put the logic in
PolynomialRing
than to pollute the __call__ method of every possible ring.

There are many more examples like this.

Michel



On May 22, 8:23 am, Robert Bradshaw <[EMAIL PROTECTED]>
wrote:
> On May 21, 2007, at 11:12 PM, Michel wrote:
>
> > Maybe instead of __call__ there should be _call_ so that
> > sage gets a chance to do  generic thing....
>
> > I.e, if P is a parent then
> > P(x) would first go through
> > sage_object.__call__(self,x) (or a similar highlevel place)
> > which would then first try
> > P._call_(x)
> > If this fails it should call something like
> > x.parent().coerce_to(P).
>
> Typically, __call__ does the actual heavy lifting and gets invoked
> when coercion is valid. I can't think of any instances where __call__
> returns a non-canonical coercion when there is one, so the extra
> method call would be redundant.
>
> - Robert


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to