> I guess "safe" is a matter of personal taste. I find
> 
> sage: GF(5)(0) == 0
> True
> sage: GF(5)(1) == 1
> True
> sage: GF(5)(-1) == -1
> True
> 
> to be "safe," but it seems some people are really bothered by this  
> idea and would rather have to write "a == a.parent().coerce(1)"

I'd rather write a.parent().one or a.parent().one() or a.parent().unit()
or... rather than to ask for coercion. IE if you are in a ring you are
supposed to have unit which can be a complicated data structure (eg 1000x1000
sparse matrix or something even worse). If it's the case, the methods which
compute it should have a cache if it's not an attribute whereas coerce clearly
can't have reasonable cache for large base ring. I don't think having coerce
do a particular thing for 0, 1 or -1 is reasonable...  

Cheers,

Florent

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

Reply via email to