Re: numeric emulation and __pos__

2008-07-09 Thread Sion Arrowsmith
Ethan Furman <[EMAIL PROTECTED]> wrote: >Anybody have an example of when the unary + actually does something? I've seen it (jokingly) used to implement a prefix increment operator. I'm not going to repeat the details in case somebody decides it's serious code. -- \S -- [EMAIL PROTECTED] -- http

Re: numeric emulation and __pos__

2008-07-09 Thread samwyse
On Jul 8, 12:34 pm, Ethan Furman <[EMAIL PROTECTED]> wrote: > Anybody have an example of when the unary + actually does something? > Besides the below Decimal example.  I'm curious under what circumstances > it would be useful for more than just completeness (although > completeness for it's own s

Re: numeric emulation and __pos__

2008-07-08 Thread casevh
On Jul 7, 4:12 pm, Ethan Furman <[EMAIL PROTECTED]> wrote: > Greetings, List! > > I'm working on a numeric data type for measured values that will keep > track of and limit results to the number of significant digits > originally defined for the values in question. > > I am doing this primarily bec

Re: numeric emulation and __pos__

2008-07-08 Thread Ethan Furman
Terry Reedy wrote: Ethan Furman wrote: Anybody have an example of when the unary + actually does something? Besides the below Decimal example. I'm curious under what circumstances it would be useful for more than just completeness (although completeness for it's own sake is important, IMO).

Re: numeric emulation and __pos__

2008-07-08 Thread Terry Reedy
Ethan Furman wrote: Anybody have an example of when the unary + actually does something? Besides the below Decimal example. I'm curious under what circumstances it would be useful for more than just completeness (although completeness for it's own sake is important, IMO). All true operators

Re: numeric emulation and __pos__

2008-07-08 Thread Ethan Furman
Mark Dickinson wrote: On Jul 8, 12:12 am, Ethan Furman <[EMAIL PROTECTED]> wrote: 1) Any reason to support the less common operators? i.e. <<, >>, &, ^, | No reason to support any of these for a nonintegral nonbinary type, as far as I can see. 2) What, exactly, does .__pos__() do? A

Re: numeric emulation and __pos__

2008-07-08 Thread Mark Dickinson
On Jul 8, 12:12 am, Ethan Furman <[EMAIL PROTECTED]> wrote: > 1) Any reason to support the less common operators? >         i.e. <<, >>, &, ^, | No reason to support any of these for a nonintegral nonbinary type, as far as I can see. > 2) What, exactly, does .__pos__() do?  An example would help,

Re: numeric emulation and __pos__

2008-07-08 Thread samwyse
On Jul 7, 6:12 pm, Ethan Furman <[EMAIL PROTECTED]> wrote: > Greetings, List! > > I'm working on a numeric data type for measured values that will keep > track of and limit results to the number of significant digits > originally defined for the values in question. > > I am doing this primarily bec