> * 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 Jan 5, 1:27 am, Volker Braun wrote:
> 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
On 2013-01-05, Simon King wrote:
> Hi Dima,
>
> On 2013-01-05, Dima Pasechnik wrote:
>> On 2013-01-05, Simon King wrote:
>>> sage: a.abs # but that's good:
>>> NotImplemented
>>
>> this is still a hack, as R() might in principle not have anything to do
>> with abs(). In such a case NotIm
Hi Dima,
On 2013-01-05, Dima Pasechnik wrote:
> On 2013-01-05, Simon King wrote:
>> sage: a.abs # but that's good:
>> NotImplemented
>
> this is still a hack, as R() might in principle not have anything to do
> with abs(). In such a case NotImplemented is misleading, and it better
> be t
On 2013-01-05, Simon King wrote:
> Hi John,
>
> On 2013-01-05, john_perry_usm wrote:
>> 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 r
Hi John,
On 2013-01-05, john_perry_usm wrote:
> 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 functions, then declare in th
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
On Saturday, January 5, 2013 4:50:35 AM UTC, Nils Bruin wrote:
> Perhaps more importantly: What is to be gained with the added
> indirection of abs
Naming consistency. It makes it clear that you are supposed to implement
absolute value through __abs__() and not norm() or absolute_value() etc.
On Jan 4, 8:17 pm, Dima Pasechnik wrote:
> > The abs() method is defined in sage.structure.element.RingElement. If
>
> but why? not all rings have any meaningful abs()..
>
> > that method makes sense for your specific class of ring elements,
> > implement a method __abs__.
Perhaps more importantl
On 2013-01-04, Simon King wrote:
> Hi Nathann,
>
> On 2013-01-04, Nathann Cohen wrote:
>> --e89a8f6467594d8d3f04d276c2d8
>> Content-Type: text/plain; charset=ISO-8859-1
>> sage: p
>> x^3 - 3*x
>> sage: p.abs()
>> ...
>> AttributeError:
>> 'sage.rings.polynomial.polynomial_integer_dense_flint.Poly
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 don't know if this could be doable, but here is a proposal: to
modify the tab completion code so that methods that consist only in
raising a NotImplemented error are not shown.
This way we could keep the structure there for developpers to follow
the name conventions, and we wouldn't confuse user
Helloo !!!
Well, it provides a general interface for typical tasks (in order to avoid
> that the same functionality is provided by methods of different names in
> different classes). I think it's useful, even though it means that some
> methods
> exist in a context in which they ma
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
Hi Nathann,
On 2013-01-04, Nathann Cohen wrote:
> --e89a8f6467594d8d3f04d276c2d8
> Content-Type: text/plain; charset=ISO-8859-1
> sage: p
> x^3 - 3*x
> sage: p.abs()
> ...
> AttributeError:
> 'sage.rings.polynomial.polynomial_integer_dense_flint.Polynomial_integer_dense_flint'
> object has no att
Hi Nathan,
What do you mean by calling absolute value or norm of a polynomial? Why
should these methods even be defined?
Cheers,
J
On Friday, January 4, 2013 1:50:14 PM UTC, Nathann Cohen wrote:
>
> Hell everybody !!!
>
> Of course I do not know if what I do has any meaning, but I sti
17 matches
Mail list logo