On Saturday, January 5, 2013 8:45:47 AM UTC, Nathann Cohen wrote:

> What the hell ? You are *NOT* supposed to implement an abs() method, 
> because such a method does not necessarily make sense !
>

There is certainly an argument to be made that abs() should or should not 
be defined by default. But Nils' question wasn't really about the 
particular use of abs() but why this mechanism is there in general.

Also, x.__abs__() is just the Python magic method for abs(x). The function 
call syntax abs(x) will always call __abs__ and return an AttributeError if 
it is not defined. So all we have is an x.abs() method that behaves exactly 
like abs(x), for better or worse. 


-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
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.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.


Reply via email to