Re: Annoying octal notation

2009-09-04 Thread NevilleDNZ
On Sep 3, 2:57 pm, James Harris wrote: > On 3 Sep, 14:26, Albert van der Horst > wrote: > > > In article > > <6031ba08-08c8-416b-91db-ce8ff57ae...@w6g2000yqw.googlegroups.com>, > > James Harris   wrote: > > > > > >So you are saying that Smalltalk has r where > > >r is presumably for radix? That

Re: Annoying octal notation

2009-09-03 Thread MRAB
Albert van der Horst wrote: In article <6b5ea596-d1e3-483d-ba79-7b139d3c7...@z24g2000yqb.googlegroups.com>, Bearophile wrote: MRAB: '_': what if in the future we want to allow them in numbers for clarity? Hettinger says it's hard (= requires too many changes) to do that and Python programs

Re: Annoying octal notation

2009-09-03 Thread James Harris
On 3 Sep, 15:54, Albert van der Horst wrote: > In article , > Derek Martin   wrote: > > > > > > >--W1uEbMXJ1Mj4g6TI > >Content-Type: text/plain; charset=iso-8859-1 > >Content-Disposition: inline > > >On Mon, Aug 24, 2009 at 05:03:28PM +, Steven D'Aprano wrote: > >> On Mon, 24 Aug 2009 11:21:46

Re: Annoying octal notation

2009-09-03 Thread James Harris
On 3 Sep, 15:35, Grant Edwards wrote: ... > >>> Obviously I can't speak for Ken Thompson's motivation in creating this > >>> feature, but I'm pretty sure it wasn't to save typing or space on > >>> punchcards. Even in 1969, hex was more common than octal, and yet hex > >>> values are written with

Re: Annoying octal notation

2009-09-03 Thread James Harris
On 3 Sep, 14:26, Albert van der Horst wrote: > In article <6031ba08-08c8-416b-91db-ce8ff57ae...@w6g2000yqw.googlegroups.com>, > James Harris   wrote: > > > > > >So you are saying that Smalltalk has r where > >r is presumably for radix? That's maybe best of all. It preserves the > >syntactic requi

Re: Annoying octal notation

2009-09-03 Thread Grant Edwards
On 2009-09-03, Albert van der Horst wrote: > In article , > MRAB wrote: >>Steven D'Aprano wrote: > >>> Obviously I can't speak for Ken Thompson's motivation in creating this >>> feature, but I'm pretty sure it wasn't to save typing or space on >>> punchcards. Even in 1969, hex was more common th

Re: Annoying octal notation

2009-09-03 Thread Albert van der Horst
In article , Derek Martin wrote: > >--W1uEbMXJ1Mj4g6TI >Content-Type: text/plain; charset=iso-8859-1 >Content-Disposition: inline > >On Mon, Aug 24, 2009 at 05:03:28PM +, Steven D'Aprano wrote: >> On Mon, 24 Aug 2009 11:21:46 -0500, Derek Martin wrote: >> > since the old syntax is prevalent b

Re: Annoying octal notation

2009-09-03 Thread Albert van der Horst
In article <6b5ea596-d1e3-483d-ba79-7b139d3c7...@z24g2000yqb.googlegroups.com>, Bearophile wrote: >MRAB: > >>'_': what if in the future we want to allow them in numbers for clarity? > >Hettinger says it's hard (= requires too many changes) to do that and >Python programs don't have big integer co

Re: Annoying octal notation

2009-09-03 Thread sjm
On Aug 21, 2:45 pm, John Nagle wrote: >      In 2009, Unisys finally exited the mainframe hardware business, and the > last of the 36-bit machines, the ClearPath servers, are being phased out. > That line of machines goes back to the UNIVAC 2200 series, and the UNIVAC > 1100 series, all the way b

Re: Annoying octal notation

2009-09-03 Thread Albert van der Horst
In article , MRAB wrote: >Steven D'Aprano wrote: >> Obviously I can't speak for Ken Thompson's motivation in creating this >> feature, but I'm pretty sure it wasn't to save typing or space on >> punchcards. Even in 1969, hex was more common than octal, and yet hex >> values are written with 0x.

Re: Annoying octal notation

2009-09-03 Thread Albert van der Horst
In article <6031ba08-08c8-416b-91db-ce8ff57ae...@w6g2000yqw.googlegroups.com>, James Harris wrote: > >So you are saying that Smalltalk has r where >r is presumably for radix? That's maybe best of all. It preserves the >syntactic requirement of starting a number with a digit and seems to >have gr

Re: Annoying octal notation

2009-08-30 Thread Hendrik van Rooyen
On Monday 24 August 2009 16:14:25 Derek Martin wrote: > In fact, now that I think of it... > > I just looked at some old school papers I had tucked away in a family > album. I'm quite sure that in grammar school, I was tought to use a > date format of 8/9/79, without leading zeros. I can't prove

Re: Annoying octal notation

2009-08-29 Thread Grant Edwards
On 2009-08-28, Neil Hodgson wrote: > Steven D'Aprano: > >> Obviously I can't speak for Ken Thompson's motivation in creating this >> feature, but I'm pretty sure it wasn't to save typing or space on >> punchcards. > >The original implementation of UNIX was on a PDP-7 which was an > 18-bit ma

Re: Annoying octal notation

2009-08-28 Thread Neil Hodgson
Steven D'Aprano: > Obviously I can't speak for Ken Thompson's motivation in creating this > feature, but I'm pretty sure it wasn't to save typing or space on > punchcards. The original implementation of UNIX was on a PDP-7 which was an 18-bit machine. Octal = 3 bits at a a time which evenly

Re: Annoying octal notation

2009-08-28 Thread MRAB
Steven D'Aprano wrote: On Thu, 27 Aug 2009 10:31:04 -0700, Ethan Furman wrote: Steven D'Aprano wrote: A mistake is still a mistake even if it shared with others. Treating its with a lead zero as octal was a design error when it was first thought up [snippage] I have to disagree with you on

Re: Annoying octal notation

2009-08-28 Thread Steven D'Aprano
On Thu, 27 Aug 2009 10:31:04 -0700, Ethan Furman wrote: > Steven D'Aprano wrote: >> A mistake is still a mistake even if it shared with others. >> >> Treating its with a lead zero as octal was a design error when it was >> first thought up > > [snippage] > > I have to disagree with you on this

Re: Annoying octal notation

2009-08-27 Thread Mel
Steven D'Aprano wrote: > Leading zeroes in decimal numbers are *very* common in dates and times. In banking too, according to someone at work today. Mel. -- http://mail.python.org/mailman/listinfo/python-list

Re: Annoying octal notation

2009-08-27 Thread Ethan Furman
MRAB wrote: Ethan Furman wrote: Steven D'Aprano wrote: A mistake is still a mistake even if it shared with others. Treating its with a lead zero as octal was a design error when it was first thought up [snippage] I have to disagree with you on this one. The computing world was vastly

Re: Annoying octal notation

2009-08-27 Thread Ethan Furman
James Harris wrote: On 27 Aug, 18:31, Ethan Furman wrote: Steven D'Aprano wrote: A mistake is still a mistake even if it shared with others. Treating its with a lead zero as octal was a design error when it was first thought up [snippage] I have to disagree with you on this one. Th

Re: Annoying octal notation

2009-08-27 Thread James Harris
On 27 Aug, 18:31, Ethan Furman wrote: > Steven D'Aprano wrote: > > A mistake is still a mistake even if it shared with others. > > > Treating its with a lead zero as octal was a design error when it was > > first thought up > > [snippage] > > I have to disagree with you on this one.  The computi

Re: Annoying octal notation

2009-08-27 Thread MRAB
Ethan Furman wrote: Steven D'Aprano wrote: A mistake is still a mistake even if it shared with others. Treating its with a lead zero as octal was a design error when it was first thought up [snippage] I have to disagree with you on this one. The computing world was vastly different when

Re: Annoying octal notation

2009-08-27 Thread Ethan Furman
Steven D'Aprano wrote: A mistake is still a mistake even if it shared with others. Treating its with a lead zero as octal was a design error when it was first thought up [snippage] I have to disagree with you on this one. The computing world was vastly different when that design decision

Re: Annoying octal notation

2009-08-24 Thread Mensanator
On Aug 24, 10:20�pm, Erik Max Francis wrote: > Steven D'Aprano wrote: > > On Mon, 24 Aug 2009 09:14:25 -0500, Derek Martin wrote: > > >> Assuming I'm right about that, then the use of a leading 0 to represent > >> octal actually predates the prevalence of using 0 in dates by almost two > >> decade

Re: Annoying octal notation

2009-08-24 Thread Erik Max Francis
Steven D'Aprano wrote: On Mon, 24 Aug 2009 09:14:25 -0500, Derek Martin wrote: Assuming I'm right about that, then the use of a leading 0 to represent octal actually predates the prevalence of using 0 in dates by almost two decades. And while using leading zeros in other contexts is "familiar"

Re: Annoying octal notation

2009-08-24 Thread Steven D'Aprano
On Mon, 24 Aug 2009 12:40:24 -0500, Derek Martin wrote: > On Mon, Aug 24, 2009 at 05:03:28PM +, Steven D'Aprano wrote: >> On Mon, 24 Aug 2009 11:21:46 -0500, Derek Martin wrote: >> > since the old syntax is prevalent both within and without the Python >> > community, making the change is, was,

Re: Annoying octal notation

2009-08-24 Thread Derek Martin
On Mon, Aug 24, 2009 at 04:40:14PM -0300, Gabriel Genellina wrote: > En Mon, 24 Aug 2009 14:40:24 -0300, Derek Martin > escribió: > > >Why is it so hard for you to accept that intelligent people can > >disagree with you, and that what's right for you might be bad for > >others? > > Ask the same

Re: Annoying octal notation

2009-08-24 Thread Gabriel Genellina
En Mon, 24 Aug 2009 14:40:24 -0300, Derek Martin escribió: Why is it so hard for you to accept that intelligent people can disagree with you, and that what's right for you might be bad for others? Ask the same question yourself please. -- Gabriel Genellina -- http://mail.python.org/mailma

Re: Annoying octal notation

2009-08-24 Thread Derek Martin
On Mon, Aug 24, 2009 at 05:03:28PM +, Steven D'Aprano wrote: > On Mon, 24 Aug 2009 11:21:46 -0500, Derek Martin wrote: > > since the old syntax is prevalent both within and without the > > Python community, making the change is, was, and always will be a > > bad idea. > > Octal syntax isn't pre

Re: Annoying octal notation

2009-08-24 Thread Harald Luessen
On Mon, 24 Aug 2009 Derek Martin wrote: >Those participating in this thread have pretty much all seem to agree >that the only places where decimal numbers with leading zeros really >are common are either in rather specialized applications, such as >computer-oriented data or serial numbers (which ty

Re: Annoying octal notation

2009-08-24 Thread Steven D'Aprano
On Mon, 24 Aug 2009 11:21:46 -0500, Derek Martin wrote: > since the old > syntax is prevalent both within and without the Python community, making > the change is, was, and always will be a bad idea. Octal syntax isn't prevalent *at all*, except in a small number of niche areas. You've said tha

Re: Annoying octal notation

2009-08-24 Thread Derek Martin
On Mon, Aug 24, 2009 at 04:47:43PM +, Steven D'Aprano wrote: > Except of course to anyone familiar with mathematics in the last, oh, > five hundred years or so. Mathematics has used a positional system for > numbers for centuries now: leading zeroes have been insignificant, just > like trail

Re: Annoying octal notation

2009-08-24 Thread Steven D'Aprano
On Mon, 24 Aug 2009 09:14:25 -0500, Derek Martin wrote: > Assuming I'm right about that, then the use of a leading 0 to represent > octal actually predates the prevalence of using 0 in dates by almost two > decades. And while using leading zeros in other contexts is "familiar" > to me, I would ce

Re: Annoying octal notation

2009-08-24 Thread Derek Martin
On Mon, Aug 24, 2009 at 08:31:13AM -0700, Carl Banks wrote: > On Aug 24, 6:56 am, Derek Martin wrote: > > I think hard-coding dates is more uncommon than using octal. ;-) > > [It unquestionably is, for me personally.] > > You just don't get it, do you? I think I get it just fine, thanks. > Do

Re: Annoying octal notation

2009-08-24 Thread Derek Martin
On Mon, Aug 24, 2009 at 05:22:39PM +0200, Hendrik van Rooyen wrote: > > Assuming I'm right about that, then the use of a leading 0 to > > represent octal actually predates the prevalence of using 0 in dates > > by almost two decades. > > Not quite - at the time I started, punch cards and data ent

Re: Annoying octal notation

2009-08-24 Thread Carl Banks
On Aug 24, 6:56 am, Derek Martin wrote: > I think > hard-coding dates is more uncommon than using octal. ;-)  [It > unquestionably is, for me personally.] You just don't get it, do you? Do you really think this is a contest over what's more common and the winner gets to choose the syntax? You r

Re: Annoying octal notation

2009-08-24 Thread Derek Martin
On Mon, Aug 24, 2009 at 08:56:48AM -0500, Derek Martin wrote: > On Sun, Aug 23, 2009 at 01:13:32PM +, Matthew Woodcraft wrote: > > A more common case is dates. > > I suppose this is true, but [...] > I tend to also discount this example, because when we write dates > with leading zeros, usuall

Re: Annoying octal notation

2009-08-24 Thread Derek Martin
On Sun, Aug 23, 2009 at 01:13:32PM +, Matthew Woodcraft wrote: > Dennis Lee Bieber writes: > > About the only place one commonly sees leading zeros on decimal > > numbers, in my experience, is zero-filled COBOL data decks (and since > > classic COBOL stores in BCD anyway... binary (usage i

Re: Annoying octal notation

2009-08-24 Thread Derek Martin
On Sun, Aug 23, 2009 at 06:13:31AM +, Steven D'Aprano wrote: > On Sat, 22 Aug 2009 22:19:01 -0500, Derek Martin wrote: > > On Sat, Aug 22, 2009 at 02:55:51AM +, Steven D'Aprano wrote: > >> And the great thing is that now you get to teach yourself to stop > >> writing octal numbers implicitl

Re: Annoying octal notation

2009-08-23 Thread James Harris
On 21 Aug, 00:59, James Harris wrote: ... > > Is there some magic to make the 2.x CPython interpreter to ignore the > > annoying octal notation? > > I'd really like 012 to be "12" and not "10". > > This is (IMHO) a sad hangover from C (which took it from B ... This seemed worth writing up so I'

Re: Annoying octal notation

2009-08-23 Thread Matthew Woodcraft
Dennis Lee Bieber writes: > About the only place one commonly sees leading zeros on decimal > numbers, in my experience, is zero-filled COBOL data decks (and since > classic COBOL stores in BCD anyway... binary (usage is > computational/comp-1) was a later add-on to the data specification mo

Re: Annoying octal notation

2009-08-23 Thread Bearophile
MRAB: >'_': what if in the future we want to allow them in numbers for clarity? Hettinger says it's hard (= requires too many changes) to do that and Python programs don't have big integer constants often enough, so probably that improvement will not see the light. In the meantime in a Python pr

Re: Annoying octal notation

2009-08-22 Thread Steven D'Aprano
On Sat, 22 Aug 2009 22:19:01 -0500, Derek Martin wrote: > On Sat, Aug 22, 2009 at 02:55:51AM +, Steven D'Aprano wrote: >> > I can see how 012 can >> > be confusing to new programmers, but at least it's legible, and the >> > great thing about humans is that they can be taught (usually). >> >>

Re: Annoying octal notation

2009-08-22 Thread Steven D'Aprano
On Sat, 22 Aug 2009 14:04:17 -0500, Derek Martin wrote: >> These human programmers, whether newbies or long-experienced, also deal >> with decimal numbers every day, many of which are presented as a >> sequence of digits with leading zeros — and we continue to think of >> them as decimal numbers r

Re: Annoying octal notation

2009-08-22 Thread Derek Martin
On Fri, Aug 21, 2009 at 04:23:57PM -0700, James Harris wrote: > You misunderstand. I was saying that taking a leading zero as > indicating octal is archaic. Octal itself is fine where appropriate. I don't see that the leading zero is any more archaic than the use of octal itself... Both originate

Re: Annoying octal notation

2009-08-22 Thread Derek Martin
On Sat, Aug 22, 2009 at 02:55:51AM +, Steven D'Aprano wrote: > > I can see how 012 can > > be confusing to new programmers, but at least it's legible, and the > > great thing about humans is that they can be taught (usually). > > And the great thing is that now you get to teach yourself to sto

Re: Annoying octal notation

2009-08-22 Thread Carl Banks
On Aug 21, 12:48 pm, Derek Martin wrote: > John Nagle wrote: > > Yes, and making lead zeros an error as suggested in PEP 3127 is a > > good idea.  It will be interesting to see what bugs that flushes > > out. > James Harris wrote: > > It maybe made sense once but this relic of the past should have

Re: Annoying octal notation

2009-08-22 Thread Carl Banks
On Aug 22, 12:04 pm, Derek Martin wrote: > On Sat, Aug 22, 2009 at 10:03:35AM +1000, Ben Finney wrote: > > These human programmers, whether newbies or long-experienced, also deal > > with decimal numbers every day, many of which are presented as a > > sequence of digits with leading zeros — and we

Re: Annoying octal notation

2009-08-22 Thread Jan Kaliszewski
22-08-2009 o 21:04:17 Derek Martin wrote: On Sat, Aug 22, 2009 at 10:03:35AM +1000, Ben Finney wrote: These human programmers, whether newbies or long-experienced, also deal with decimal numbers every day, many of which are presented as a sequence of digits with leading zeros — and we contin

Re: Annoying octal notation

2009-08-22 Thread Derek Martin
On Sat, Aug 22, 2009 at 10:03:35AM +1000, Ben Finney wrote: > > and the former is virtually indistinguishable from 00012, O0012, or > > many other combinations that someone might accidentally type (or > > intentionally type, having to do this in dozens of other programming > > languages). > > Only

Re: Annoying octal notation

2009-08-22 Thread Grant Edwards
On 2009-08-22, Dennis Lee Bieber wrote: > On Fri, 21 Aug 2009 10:45:51 -0700, John Nagle > declaimed the following in gmane.comp.python.general: > >> >> And it's over. We can finally dispense with octal by default. >> > I've not looked at modern Intel processor format, but if there a

Re: Annoying octal notation

2009-08-22 Thread MRAB
David wrote: Il Fri, 21 Aug 2009 16:52:29 -0700 (PDT), James Harris ha scritto: 0xff & 0x0e | 0b1101 16rff & 16r0e | 2r1101 Hmm. Maybe a symbol would be better than a letter. What about 2_1011, 8_7621, 16_c26h or 2;1011, 8;7621, 16;c26h ? '_': what if in the future we want to allow th

Re: Annoying octal notation

2009-08-22 Thread MRAB
Dennis Lee Bieber wrote: On Fri, 21 Aug 2009 16:52:29 -0700 (PDT), James Harris declaimed the following in gmane.comp.python.general: So you are saying that Smalltalk has r where r is presumably for radix? That's maybe best of all. It preserves the syntactic requirement of starting a number wi

Re: Annoying octal notation

2009-08-22 Thread David
Il Thu, 20 Aug 2009 16:59:14 -0700 (PDT), James Harris ha scritto: > > It maybe made sense once but this relic of the past should have been > consigned to the waste bin of history long ago. I perfectly agree with you! David. -- http://mail.python.org/mailman/listinfo/python-list

Re: Annoying octal notation

2009-08-22 Thread Steven D'Aprano
On Sat, 22 Aug 2009 11:15:16 +0200, David wrote: > 3) I don't understand why useless but *harmless* things like > algebrically insignificant leading zeros should be *forbidden* and > promoted to errors. The PEP covering this change says: "There are still some strong feelings that '0123' should b

Re: Annoying octal notation

2009-08-22 Thread David
Il Fri, 21 Aug 2009 16:52:29 -0700 (PDT), James Harris ha scritto: > > 0xff & 0x0e | 0b1101 > 16rff & 16r0e | 2r1101 > > Hmm. Maybe a symbol would be better than a letter. What about 2_1011, 8_7621, 16_c26h or 2;1011, 8;7621, 16;c26h ? David -- http://mail.python.org/mailman/listinfo/pyt

Re: Annoying octal notation

2009-08-22 Thread David
Il Fri, 21 Aug 2009 10:36:35 -0700 (PDT), Mensanator ha scritto: > Aha! Then I WAS right after all. Switch to 3.1 and you'll > soon be cured of that bad habit: > 012 + 012 > SyntaxError: invalid token (, line 1) I have tre (four) problems: 1) I am forced to use 2.5 since the production ser

Re: Annoying octal notation

2009-08-21 Thread Steven D'Aprano
On Fri, 21 Aug 2009 14:48:57 -0500, Derek Martin wrote: >> It maybe made sense once but this relic of the past should have been >> consigned to the waste bin of history long ago. > > Sigh. Nonsense. I use octal notation *every day*, for two extremely > prevalent purposes: file creation umask, a

Re: Annoying octal notation

2009-08-21 Thread Ben Finney
Derek Martin writes: > Sure, but that won't stop people who've been writing code for 20 years > from continuing to type octal that way... Humans can learn fairly > easily, but UN-learning is often much harder, especially when the > behavior to be unlearned is still very commonly in use. This is

Re: Annoying octal notation

2009-08-21 Thread Ben Finney
Derek Martin writes: > James Harris wrote: > > It maybe made sense once but this relic of the past should have been > > consigned to the waste bin of history long ago. > > Sigh. Nonsense. I use octal notation *every day*, for two extremely > prevalent purposes: file creation umask, and Unix file

Re: Annoying octal notation

2009-08-21 Thread James Harris
On 21 Aug, 22:18, MRAB wrote: > Piet van Oostrum wrote: > >> Derek Martin (DM) wrote: > > >> DM> I fail to see how 0O012, or even 0o012 is more intelligible than 012. > >> DM> The latter reads like a typo, and the former is virtually > >> DM> indistinguishable from 00012, O0012, or many other

Re: Annoying octal notation

2009-08-21 Thread James Harris
On 21 Aug, 20:48, Derek Martin wrote: ... > James Harris wrote: > > It maybe made sense once but this relic of the past should have been > > consigned to the waste bin of history long ago. > > Sigh.  Nonsense.  I use octal notation *every day*, for two extremely > prevalent purposes: file creati

Re: Annoying octal notation

2009-08-21 Thread MRAB
Piet van Oostrum wrote: Derek Martin (DM) wrote: DM> I fail to see how 0O012, or even 0o012 is more intelligible than 012. DM> The latter reads like a typo, and the former is virtually DM> indistinguishable from 00012, O0012, or many other combinations that DM> someone might accidentally type

Re: Annoying octal notation

2009-08-21 Thread Piet van Oostrum
> Derek Martin (DM) wrote: >DM> I fail to see how 0O012, or even 0o012 is more intelligible than 012. >DM> The latter reads like a typo, and the former is virtually >DM> indistinguishable from 00012, O0012, or many other combinations that >DM> someone might accidentally type (or intentionally

Re: Annoying octal notation

2009-08-21 Thread Derek Martin
On Fri, Aug 21, 2009 at 08:25:45PM +, Benjamin Peterson wrote: > > More than flushing out bugs, it will *cause* them in ubiquity, > > requiring likely terabytes of code to be poured over and fixed. > > 2to3, however, can fix it for you extreme easily. Sure, but that won't stop people who've b

Re: Annoying octal notation

2009-08-21 Thread Benjamin Peterson
Derek Martin pizzashack.org> writes: > More than flushing out > bugs, it will *cause* them in ubiquity, requiring likely terabytes of > code to be poured over and fixed. 2to3, however, can fix it for you extreme easily. -- http://mail.python.org/mailman/listinfo/python-list

Re: Annoying octal notation

2009-08-21 Thread Benjamin Peterson
Simon Forman gmail.com> writes: > No. You would have to modify and recompile the interpreter. This is > not exactly trivial, see "How to Change Python's Grammar" > http://www.python.org/dev/peps/pep-0306/ And even that's incorrect. You'd have to modify the tokenizer. -- http://mail.python.o

Re: Annoying octal notation

2009-08-21 Thread Derek Martin
John Nagle wrote: > Yes, and making lead zeros an error as suggested in PEP 3127 is a > good idea. It will be interesting to see what bugs that flushes > out. James Harris wrote: > It maybe made sense once but this relic of the past should have been > consigned to the waste bin of history long ag

Re: Annoying octal notation

2009-08-21 Thread John Nagle
Simon Forman wrote: On Aug 20, 3:06 pm, David <71da...@libero.it> wrote: Hi all, Is there some magic to make the 2.x CPython interpreter to ignore the annoying octal notation? No. You would have to modify and recompile the interpreter. This is not exactly trivial, see "How to Change Python's

Re: Annoying octal notation

2009-08-21 Thread Mensanator
On Aug 21, 11:40 am, David <71da...@libero.it> wrote: > Il Thu, 20 Aug 2009 15:18:35 -0700 (PDT), Mensanator ha scritto: > > > (Just kidding! That works in 2.5 also. How are you using it where > > it's coming out wrong? I can see you pulling '012' out of a text > > file and want to calculate with i

Re: Annoying octal notation

2009-08-21 Thread MRAB
David wrote: Il Thu, 20 Aug 2009 22:24:24 +0200, Johannes Bauer ha scritto: David schrieb: If I want an octal I'll use oct()! "Explicit is better than implicit..." A leading "0" *is* explicit. It isn't explicit enough, at least IMO. Is this better? Python 3.1 (r31:73574, Jun 26 2009,

Re: Annoying octal notation

2009-08-21 Thread David
Il Thu, 20 Aug 2009 15:18:35 -0700 (PDT), Mensanator ha scritto: > (Just kidding! That works in 2.5 also. How are you using it where > it's coming out wrong? I can see you pulling '012' out of a text > file and want to calculate with it, but how would you use a > string without using int()? Passin

Re: Annoying octal notation

2009-08-21 Thread David
Il Thu, 20 Aug 2009 22:24:24 +0200, Johannes Bauer ha scritto: > David schrieb: > >> If I want an octal I'll use oct()! >> >> "Explicit is better than implicit..." > > A leading "0" *is* explicit. It isn't explicit enough, at least IMO. regards David -- http://mail.python.org/mailman/listi

Re: Annoying octal notation

2009-08-20 Thread James Harris
On 20 Aug, 20:06, David <71da...@libero.it> wrote: > Hi all, > > Is there some magic to make the 2.x CPython interpreter to ignore the > annoying octal notation? > I'd really like 012 to be "12" and not "10". This is (IMHO) a sad hangover from C (which took it from B but not from BCPL which used

Re: Annoying octal notation

2009-08-20 Thread Mensanator
On Aug 20, 2:06 pm, David <71da...@libero.it> wrote: > Hi all, > > Is there some magic to make the 2.x CPython interpreter to ignore the > annoying octal notation? > I'd really like 012 to be "12" and not "10". Use 3.1: >>> int('012') 12 (Just kidding! That works in 2.5 also. How are you using

Re: Annoying octal notation

2009-08-20 Thread Simon Forman
On Aug 20, 3:06 pm, David <71da...@libero.it> wrote: > Hi all, > > Is there some magic to make the 2.x CPython interpreter to ignore the > annoying octal notation? No. You would have to modify and recompile the interpreter. This is not exactly trivial, see "How to Change Python's Grammar" http://

Re: Annoying octal notation

2009-08-20 Thread Johannes Bauer
David schrieb: > If I want an octal I'll use oct()! > > "Explicit is better than implicit..." A leading "0" *is* explicit. Implicit would be when some functions would interpret a "0" prefix as octal and others wouldn't. Regards, Johannes -- "Meine Gegenklage gegen dich lautet dann auf bewus