Re: Mixing Decimal and float

2010-06-04 Thread B.V.
On Jun 2, 10:35 pm, I V wrote: > On Wed, 02 Jun 2010 05:17:11 -0700, B.V. wrote: > > But trying to be open to other languages, the server implements also an > > XMLRPC interface (and also a JSONRPC-like interface). That's the key > > point: Decimal is python specific. So in an application, you can

Re: Mixing Decimal and float

2010-06-04 Thread B.V.
On Jun 3, 2:00 am, Chris Rebert wrote: > On Wed, Jun 2, 2010 at 4:11 PM, Steven D'Aprano > > wrote: > > On Wed, 02 Jun 2010 17:17:11 -0400, Nathan Rice wrote: > >> My apologies if someone already mentioned this and I missed it but... > > >> class.__instancecheck__(self, instance) - Return true if

Re: Mixing Decimal and float

2010-06-02 Thread Chris Rebert
On Wed, Jun 2, 2010 at 4:11 PM, Steven D'Aprano wrote: > On Wed, 02 Jun 2010 17:17:11 -0400, Nathan Rice wrote: >> My apologies if someone already mentioned this and I missed it but... >> >> class.__instancecheck__(self, instance) - Return true if instance should >> be considered a (direct or indi

Re: Mixing Decimal and float

2010-06-02 Thread Steven D'Aprano
On Wed, 02 Jun 2010 17:17:11 -0400, Nathan Rice wrote: > My apologies if someone already mentioned this and I missed it but... > > class.__instancecheck__(self, instance) - Return true if instance should > be considered a (direct or indirect) instance of class. If defined, > called to implement i

Re: Mixing Decimal and float

2010-06-02 Thread Nathan Rice
My apologies if someone already mentioned this and I missed it but... class.__instancecheck__(self, instance) - Return true if instance should be considered a (direct or indirect) instance of class. If defined, called to implement isinstance(instance, class). class.__subclasscheck__(self, subclas

Re: Mixing Decimal and float

2010-06-02 Thread I V
On Wed, 02 Jun 2010 05:17:11 -0700, B.V. wrote: > But trying to be open to other languages, the server implements also an > XMLRPC interface (and also a JSONRPC-like interface). That's the key > point: Decimal is python specific. So in an application, you can't rely > on the value received from a c

Re: Mixing Decimal and float

2010-06-02 Thread B.V.
On 2 juin, 17:08, Terry Reedy wrote: > On 6/2/2010 8:17 AM, B.V. wrote: > > > A contributor filed an issue on the bug tracker (https:// > > bugs.tryton.org/roundup/issue1575) and because he's a nice guy (ok > > it's a friend of mine), he made a patch proposal (http:// > > codereview.appspot.com/13

Re: Mixing Decimal and float

2010-06-02 Thread Terry Reedy
On 6/2/2010 8:17 AM, B.V. wrote: A contributor filed an issue on the bug tracker (https:// bugs.tryton.org/roundup/issue1575) and because he's a nice guy (ok it's a friend of mine), he made a patch proposal (http:// codereview.appspot.com/1387041). The end of the story is in the comments of the

Re: Mixing Decimal and float

2010-06-02 Thread B.V.
On Jun 2, 12:22 pm, Mark Dickinson wrote: > On Jun 2, 9:24 am, "B.V." wrote: > > > Hi, > > > In order to solve some issues due to operations between Decimal and > > float, we wanted to implement a class that inherits from both float > > and Decimal. > > > Typically, we wrote: > > > class Float(De

Re: Mixing Decimal and float

2010-06-02 Thread Mark Dickinson
On Jun 2, 9:24 am, "B.V." wrote: > Hi, > > In order to solve some issues due to operations between Decimal and > float, we wanted to implement a class that inherits from both float > and Decimal. > > Typically, we wrote: > > class Float(Decimal, float): Can you explain exactly what issues you wan

Mixing Decimal and float

2010-06-02 Thread B.V.
Hi, In order to solve some issues due to operations between Decimal and float, we wanted to implement a class that inherits from both float and Decimal. Typically, we wrote: class Float(Decimal, float): ... This can not be achieved because of a TypeError exception (with message "multiple bases h