Re: [sage-devel] Names of special methods like _pari_

2017-03-01 Thread Daniel Krenn
On 2017-02-28 17:26, Jeroen Demeyer wrote: > (4) __pari__(): consistent with Python (__int__, __str__) and NumPy > (__array__). However, creating such names possibly goes against the > Python documentation [2]. If we change it, then +1 for option (4). Daniel -- You received this message

Re: [sage-devel] Names of special methods like _pari_

2017-02-28 Thread Jeroen Demeyer
On 2017-03-01 03:43, David Roe wrote: I don't see the benefits of changing as sufficient to outweigh the costs of an incompatible change We could always keep supporting _pari_ with deprecation, so the cost of changing is zero. -- You received this message because you are subscribed to the

Re: [sage-devel] Names of special methods like _pari_

2017-02-28 Thread Jeroen Demeyer
What about _latex_? Would you plan to change that, too? Sage objects and elements have lots of single-underscore methods, like _repr_, _mul_, etc. Well, I would put _latex_ in the same basket as _pari_. But _repr_ and _mul_ are different: they deal with the implementation of SageObject/Element

Re: [sage-devel] Names of special methods like _pari_

2017-02-28 Thread David Roe
I don't see the benefits of changing as sufficient to outweigh the costs of an incompatible change, so I would vote for (1). Among the other options, (4) seems the most reasonable. David On Tue, Feb 28, 2017 at 8:57 PM, Travis Scrimshaw wrote: > > > On Tuesday, February 28,

Re: [sage-devel] Names of special methods like _pari_

2017-02-28 Thread Travis Scrimshaw
On Tuesday, February 28, 2017 at 4:41:40 PM UTC-6, John H Palmieri wrote: > > > > On Tuesday, February 28, 2017 at 1:16:53 PM UTC-8, Jeroen Demeyer wrote: >> >> On 2017-02-28 20:46, Johan S. H. Rosenkilde wrote: >> > In that case, it >> > could be seen as an implementation detail that objects

Re: [sage-devel] Names of special methods like _pari_

2017-02-28 Thread William Stein
On Tue, Feb 28, 2017 at 2:41 PM, John H Palmieri wrote: > > > On Tuesday, February 28, 2017 at 1:16:53 PM UTC-8, Jeroen Demeyer wrote: >> >> On 2017-02-28 20:46, Johan S. H. Rosenkilde wrote: >> > In that case, it >> > could be seen as an implementation detail that objects

Re: [sage-devel] Names of special methods like _pari_

2017-02-28 Thread John H Palmieri
On Tuesday, February 28, 2017 at 1:16:53 PM UTC-8, Jeroen Demeyer wrote: > > On 2017-02-28 20:46, Johan S. H. Rosenkilde wrote: > > In that case, it > > could be seen as an implementation detail that objects have the _pari > > method, and private would be apt. > > Yes, it's an

Re: [sage-devel] Names of special methods like _pari_

2017-02-28 Thread Jeroen Demeyer
On 2017-02-28 20:46, Johan S. H. Rosenkilde wrote: In that case, it could be seen as an implementation detail that objects have the _pari method, and private would be apt. Yes, it's an "implementation detail" but it's not "private". I would say it's a public implementation detail: something

Re: [sage-devel] Names of special methods like _pari_

2017-02-28 Thread Johan S . H . Rosenkilde
> > (2) _pari(): meant for private methods. This doesn't seem correct to me, > because we want this method to be part of the public API. But as Thierry says, perhaps not so public that we want it to figure in tab-completion on all objects everywhere. Isn't this exactly because most users would

Re: [sage-devel] Names of special methods like _pari_

2017-02-28 Thread Thierry
Hi, On Tue, Feb 28, 2017 at 04:41:39PM +, John Cremona wrote: > On 28 February 2017 at 16:26, Jeroen Demeyer wrote: > > This is a continuation of discussion from > > https://trac.sagemath.org/ticket/22470 > > > > I will only talk about _pari_ below but this is just an

Re: [sage-devel] Names of special methods like _pari_

2017-02-28 Thread John Cremona
On 28 February 2017 at 16:26, Jeroen Demeyer wrote: > This is a continuation of discussion from > https://trac.sagemath.org/ticket/22470 > > I will only talk about _pari_ below but this is just an example. We also > have _gap_ and others. > > Sage supports the special

[sage-devel] Names of special methods like _pari_

2017-02-28 Thread Jeroen Demeyer
This is a continuation of discussion from https://trac.sagemath.org/ticket/22470 I will only talk about _pari_ below but this is just an example. We also have _gap_ and others. Sage supports the special method _pari_() to convert arbitrary objects to PARI. Now I would like to ask the