Re: [Python-Dev] Backporting PEP 3127 to trunk

2008-02-23 Thread Guido van Rossum
On Sat, Feb 23, 2008 at 2:57 AM, Georg Brandl <[EMAIL PROTECTED]> wrote: > Eric Smith schrieb: > > > > Guido van Rossum wrote: > >> I wonder if, in order to change the behavior of various built-in > >> functions, it wouldn't be easier to be able to write > >> > >> from future_builtins import oc

Re: [Python-Dev] Backporting PEP 3127 to trunk

2008-02-23 Thread Georg Brandl
Eric Smith schrieb: > Guido van Rossum wrote: >> I wonder if, in order to change the behavior of various built-in >> functions, it wouldn't be easier to be able to write >> >> from future_builtins import oct, hex # and who knows what else > > This makes sense to me, especially if we have a 2to3

Re: [Python-Dev] Backporting PEP 3127 to trunk

2008-02-22 Thread Eric Smith
Robert Brewer wrote: > Eric Smith wrote: >> Robert Brewer wrote: >>> Postgres bytea coercion is a frequent use case for oct() in my > world. >>> But I agree we don't need two versions. >> Unless you're trying to write code to work with both 2.6 and 3.0. > > Who would try that when PEP 3000 says (i

Re: [Python-Dev] Backporting PEP 3127 to trunk

2008-02-22 Thread Bernhard Herzog
Greg Ewing <[EMAIL PROTECTED]> writes: > I don't know about oct(), but I found hex() to be quite useful > the other day when I was using the interactive interpreter to > to some hex calculations. It would have been quite tedious > having to say "%x".format(_) or some such all the time to > see the

Re: [Python-Dev] Backporting PEP 3127 to trunk

2008-02-22 Thread Robert Brewer
Eric Smith wrote: > Robert Brewer wrote: > > Raymond Hettinger wrote: > >> I thought the whole point of 3.0 was a recognition that all that > >> doubling-up was a bad thing and to be rid of it. Why make the > >> situation worse? ISTM that we need two versions of oct() like > >> we need a hole in

Re: [Python-Dev] Backporting PEP 3127 to trunk

2008-02-22 Thread Greg Ewing
Raymond Hettinger wrote: > ISTM that we need two versions of oct() like > we need a hole in the head. I don't know about oct(), but I found hex() to be quite useful the other day when I was using the interactive interpreter to to some hex calculations. It would have been quite tedious having to sa

Re: [Python-Dev] Backporting PEP 3127 to trunk

2008-02-22 Thread Eric Smith
Guido van Rossum wrote: > I wonder if, in order to change the behavior of various built-in > functions, it wouldn't be easier to be able to write > > from future_builtins import oct, hex # and who knows what else This makes sense to me, especially if we have a 2to3 fixer which removes this line

Re: [Python-Dev] Backporting PEP 3127 to trunk

2008-02-22 Thread Eric Smith
Robert Brewer wrote: > Raymond Hettinger wrote: >> I thought the whole point of 3.0 was a recognition that all that >> doubling-up was a bad thing and to be rid of it. Why make the >> situation worse? ISTM that we need two versions of oct() like >> we need a hole in the head. Heck, there's poten

Re: [Python-Dev] Backporting PEP 3127 to trunk

2008-02-22 Thread Robert Brewer
Raymond Hettinger wrote: > I thought the whole point of 3.0 was a recognition that all that > doubling-up was a bad thing and to be rid of it. Why make the > situation worse? ISTM that we need two versions of oct() like > we need a hole in the head. Heck, there's potentially a case to be > made

Re: [Python-Dev] Backporting PEP 3127 to trunk

2008-02-22 Thread Steve Holden
Raymond Hettinger wrote: > [GvR] >> . After >> all we already have lots of places where Python 2.x supports an old >> and a new way (e.g. string exceptions up to 2.5, classic classes, old >> and rich comparisons). > > I thought the whole point of 3.0 was a recognition that all that > doubling-up

Re: [Python-Dev] Backporting PEP 3127 to trunk

2008-02-22 Thread Guido van Rossum
On Fri, Feb 22, 2008 at 9:06 AM, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > [GvR] > > >. After > > all we already have lots of places where Python 2.x supports an old > > and a new way (e.g. string exceptions up to 2.5, classic classes, old > > and rich comparisons). > > I thought the whole

Re: [Python-Dev] Backporting PEP 3127 to trunk

2008-02-22 Thread Raymond Hettinger
[GvR] >. After > all we already have lots of places where Python 2.x supports an old > and a new way (e.g. string exceptions up to 2.5, classic classes, old > and rich comparisons). I thought the whole point of 3.0 was a recognition that all that doubling-up was a bad thing and to be rid of it.

Re: [Python-Dev] Backporting PEP 3127 to trunk

2008-02-22 Thread Guido van Rossum
On Thu, Feb 21, 2008 at 6:54 PM, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > [Eric Smith] > > > Speaking for myself, these features are generally useful, > > and are so even without the new integer literal syntax. > > I'm curious how these are useful to you in Py2.6 where > they are not inver

Re: [Python-Dev] Backporting PEP 3127 to trunk

2008-02-21 Thread Neal Norwitz
On Thu, Feb 21, 2008 at 2:26 PM, Eric Smith <[EMAIL PROTECTED]> wrote: > I'm going to work on backporting PEP 3127, specifically the hex, oct(), > and bin() builtins. I have bin() completed, and I'll check it in > shortly. oct() will require a future import. Does anyone have any > pointers fo

Re: [Python-Dev] Backporting PEP 3127 to trunk

2008-02-21 Thread Eric Smith
Raymond Hettinger wrote: > [Eric Smith] >> Speaking for myself, these features are generally useful, >> and are so even without the new integer literal syntax. > > I'm curious how these are useful to you in Py2.6 where > they are not invertible. In Py3.0, we can count on > > x == int(bin(x), 2

Re: [Python-Dev] Backporting PEP 3127 to trunk

2008-02-21 Thread Raymond Hettinger
[Eric Smith] > Speaking for myself, these features are generally useful, > and are so even without the new integer literal syntax. I'm curious how these are useful to you in Py2.6 where they are not invertible. In Py3.0, we can count on x == int(bin(x), 2) x == eval(bin(x)) I don't see how

Re: [Python-Dev] Backporting PEP 3127 to trunk

2008-02-21 Thread Eric Smith
Raymond Hettinger wrote: > [Eric Smith] >> I'm going to work on backporting PEP 3127, specifically >> the hex, oct(), and bin() builtins. > > IMO, these should not be backported. They are strongly > associated with 3.0's new literal syntax. They don't > don't really fit in with 2.6 and don't mak

Re: [Python-Dev] Backporting PEP 3127 to trunk

2008-02-21 Thread Raymond Hettinger
[Eric Smith] > I'm going to work on backporting PEP 3127, specifically >the hex, oct(), and bin() builtins. IMO, these should not be backported. They are strongly associated with 3.0's new literal syntax. They don't don't really fit in with 2.6 and don't make 2.6 any more attractive. Raymond _

Re: [Python-Dev] Backporting PEP 3127 to trunk

2008-02-21 Thread Guido van Rossum
I wonder if, in order to change the behavior of various built-in functions, it wouldn't be easier to be able to write from future_builtins import oct, hex # and who knows what else Agreed with your approach for bin(). On Thu, Feb 21, 2008 at 2:26 PM, Eric Smith <[EMAIL PROTECTED]> wrote: > I'm

[Python-Dev] Backporting PEP 3127 to trunk

2008-02-21 Thread Eric Smith
I'm going to work on backporting PEP 3127, specifically the hex, oct(), and bin() builtins. I have bin() completed, and I'll check it in shortly. oct() will require a future import. Does anyone have any pointers for implementing this? I understand (and have completed) adding the future impo