Re: [Python-Dev] New operations in Decimal

2007-05-14 Thread Facundo Batista
Tim Peters wrote: > I'm with Raymond on this one, especially given the triviality of > implementing the revised spec's new logical operations. Exactly. I already implemented part of it, and took less than read this thread, ;). The cost of having it is lines of code in decimal.py. The benefit is

Re: [Python-Dev] New operations in Decimal

2007-05-12 Thread Nick Coghlan
Tim Peters wrote: > [Raymond Hettinger] >> ... >> My intention for the module is to be fully compliant with the spec and all >> of its >> tests. Code written in other languages which support the spec should expect >> to be transferrable to Python and run exactly as they did in the original >> la

Re: [Python-Dev] New operations in Decimal

2007-05-11 Thread Tim Peters
[Raymond Hettinger] > ... > My intention for the module is to be fully compliant with the spec and all of > its > tests. Code written in other languages which support the spec should expect > to be transferrable to Python and run exactly as they did in the original > language. > > The module its

Re: [Python-Dev] New operations in Decimal

2007-05-11 Thread Raymond Hettinger
> The only rationale I can think of for such a thing is > that maybe they're trying to accommodate the possibility > of a machine built entirely around a hardware implementation > of the spec, that doesn't have any other way of doing > bitwise logical operations. Nonsense. The logical operations

Re: [Python-Dev] New operations in Decimal

2007-05-11 Thread Terry Reedy
"Greg Ewing" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | The only rationale I can think of for such a thing is | that maybe they're trying to accommodate the possibility | of a machine built entirely around a hardware implementation | of the spec, that doesn't have any other way

Re: [Python-Dev] New operations in Decimal

2007-05-11 Thread Nick Coghlan
Greg Ewing wrote: > Terry Reedy wrote: >> I had the same opinion until I saw the logic stuff. > > The only rationale I can think of for such a thing is > that maybe they're trying to accommodate the possibility > of a machine built entirely around a hardware implementation > of the spec, that does

Re: [Python-Dev] New operations in Decimal

2007-05-11 Thread Raymond Hettinger
> The only rationale I can think of for such a thing is > that maybe they're trying to accommodate the possibility > of a machine built entirely around a hardware implementation > of the spec, that doesn't have any other way of doing > bitwise logical operations. If that's the case, then Python >

Re: [Python-Dev] New operations in Decimal

2007-05-11 Thread Greg Ewing
Terry Reedy wrote: > "Raymond Hettinger" <[EMAIL PROTECTED]> wrote in message > | While I question the sanity of the spec writers in this case, I do trust > that > | overall, they have provided an extremely well thought-out spec, have gone > | through extensive discussion/feedback cycles, and h

Re: [Python-Dev] New operations in Decimal

2007-05-10 Thread Martin v. Löwis
> We supposedly have a standard for additions to the standard lib. I cannot > think of any other module being admitted with what amounts to an unlimited > blank check for further additions. xml.dom.minidom, xml.sax, posix, htmlentitydefs, Tkinter. Regards, Martin __

Re: [Python-Dev] New operations in Decimal

2007-05-10 Thread Terry Reedy
"Raymond Hettinger" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | > I oppose adding this illogical nonsense to Python. Who would ever use it? | | Doesn't matter. What is more important is that we provide a module that is | fully compliant with the specification and passes all

Re: [Python-Dev] New operations in Decimal

2007-05-10 Thread Raymond Hettinger
| > Am I losing my marbles, or is this a proposal to add the logical | > operations to FLOATING-POINT? | | Sort of. This is a proposal to keep compliant with the General Decimal | Arithmetic Specification, as we promised. | | http://www2.hursley.ibm.com/decimal/ > I oppose adding this illogical n

Re: [Python-Dev] New operations in Decimal

2007-05-10 Thread Terry Reedy
"Facundo Batista" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Nick Maclaren wrote: | | > Am I losing my marbles, or is this a proposal to add the logical | > operations to FLOATING-POINT? | | Sort of. This is a proposal to keep compliant with the General Decimal | Arithmetic Spe

Re: [Python-Dev] New operations in Decimal

2007-05-01 Thread Nick Maclaren
Facundo Batista <[EMAIL PROTECTED]> wrote: > > > Am I losing my marbles, or is this a proposal to add the logical > > operations to FLOATING-POINT? > > Sort of. This is a proposal to keep compliant with the General Decimal > Arithmetic Specification, as we promised. > > http://www2.hur

Re: [Python-Dev] New operations in Decimal

2007-05-01 Thread Facundo Batista
Nick Maclaren wrote: > Am I losing my marbles, or is this a proposal to add the logical > operations to FLOATING-POINT? Sort of. This is a proposal to keep compliant with the General Decimal Arithmetic Specification, as we promised. http://www2.hursley.ibm.com/decimal/ Regards, -- . Facun

Re: [Python-Dev] New operations in Decimal

2007-05-01 Thread Facundo Batista
Ronald Oussoren wrote: >> - and (and), or (or), xor (xor) [CD]: Takes two logical operands, the >> result is the logical operation applied between each digit. > > "and" and "or" are keywords, you can't have methods with those names: You're right. I'll name them logical_and, logical_or, and log

Re: [Python-Dev] New operations in Decimal

2007-05-01 Thread Nick Maclaren
Ronald Oussoren <[EMAIL PROTECTED]> wrote: > On 27 Apr, 2007, at 20:39, Facundo Batista wrote: > > > - and (and), or (or), xor (xor) [CD]: Takes two logical operands, the > > result is the logical operation applied between each digit. > > "and" and "or" are keywords, you can't have methods with

Re: [Python-Dev] New operations in Decimal

2007-05-01 Thread Ronald Oussoren
On 27 Apr, 2007, at 20:39, Facundo Batista wrote: - and (and), or (or), xor (xor) [CD]: Takes two logical operands, the result is the logical operation applied between each digit. "and" and "or" are keywords, you can't have methods with those names: >>> def and(l, r): pass File "", line