> * delete 'RingElement.abs'. Then any subclass that wants absolute
> values needs to implement __abs__ (that's necessary anyway) and, if it
> wants the method accessible in another form as well, also a suitable
> 'abs'. I could see why that's not so desirable
+1 !
Nathann
--
You received this
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. B
> Naming consistency. It makes it clear that you are supposed to implement
> absolute value through __abs__() and not norm() or absolute_value() etc.
O_O
What the hell ? You are *NOT* supposed to implement an abs() method,
because such a method does not necessarily make sense !
And by the way, r
tab-completion has been fun for me from time to time, as John Cremona points
out.
thinking of how java interfaces & multiple inheritance work: wouldn't it be
possible to have an interface orabstract class that defines an abstract
function abs, along with associated functions that require an abs
I agree with Nathan. There may well be many rings for which it makes
sense to have an abs() function, but as that is not true for all rings
I cannot see the sense in having a dummy abs() function that high up
the hierarchy.Similarly with N. Another one is version() which I
just noticed exists