On Wed, Mar 11, 2009 at 5:47 PM, Nicolas M. Thiery <nicolas.thi...@u-psud.fr> wrote: > > On Wed, Mar 11, 2009 at 10:07:35AM -0800, Carl Witty wrote: >> If you want (4), I think you should just write x.parent() == P (or if >> you know that P is unique, x.parent() is P). > > Yup. The question is: am I allowed to do it?
I'm not sure what you mean. I think it's fine for the .foo() method on A to document that it "requires that its argument have the same parent as self", and then do something like: if self.parent() is not arg.parent(): raise ValueError at the beginning of .foo(). Is that the question? >> Coercions and conversions can be marked "safe" (need a better word for >> this). A safe coercion/conversion does not change the mathematical or >> computational meaning (need a better definition); at a minimum, a safe >> coercion/conversion is invertible where it is defined. A safe >> conversion need not be defined on the entire domain. ... > Hmm. I have to think about it. For the moment, the only think I am > sure of: coercions should *always* be safe. Does this mean you want GF(5)(3)*2 and RR(pi)*2 to fail? These currently work due to coercions that would be unsafe according to my definition. Carl --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---