6 ms·
[Python-ideas] List Revolution
- briancurtin 15y agoFirst time I've laughed from a Python mailing list in a while.
- mattbillenstein 15y agoThat is clearly a freaking insane idea in a language as widely deployed as Python...
- mtogo 15y agoIt's a joke ;)
- mattbillenstein 15y agoI sincerely hope so -- I looked and it wasn't April fool's day tho...
- pyre 15y agoAn overzealous HTML sanitizer probably scrubbed the </sarcasm> tag. ;)
- emmett 15y agoIf a 1 offset under the system the guy advocates means what a 0 normally does, that implies that a +1 vote means the same thing as a +0 vote. So Guido is "agreeing" that it deserves +1, but only if you use 1-indexing so +1 is the lowest possible vote.
- pyre 15y agoBut +0 isn't the lowest possible vote in the current system... unless you want to claim that -1 is the highest possible vote because it wraps to the top of the scale.
- sp332 15y agoDon't worry, it's not going in until version 4, and version 3 isn't even the most common version yet.
- cpeterso 15y agoIs that Python 3 or Python[3]??
- makeramen 15y agowoah. (not to post something useless, but I'm literally speechless going back and forth between "that's so awesome" and "that's so dumb" in my head for so many different reasons) (and at how short and quick Guido's response was, as if it was such an easy decision to make.)
- sgk284 15y agoI suspect you're overlooking Guido's sense of humor. He was making a joke with his acceptance of the idea.
- makeramen 15y agoah ok, not that familiar with Guido, but that makes much more sense haha edit: also found this later in the thread to confirm the humor behind everything: http://mail.python.org/pipermail/python-ideas/2011-September/011454.html http://mail.python.org/pipermail/python-ideas/2011-September...
- sixtypoundhound 15y agoHe's joking right - I almost spit out my diet coke... (oh yeah...I'm sure THAT will accelerate my group's upgrade from 2.66....)
- pyre 15y agoGood news! You can have this right now in Perl: $[ = 1; Now all of your arrays are 1-indexed!
- shuzchen 15y agoLua does this already. And that's the part about Lua that I don't like. But that's mostly my personal preference speaking.
- vessenes 15y agoI am truly, truly horrified that this a language option in perl, although I'm not surprised. (Well, I did google it to see if you were joking, but you weren't, apparently). The older I get the more Larry Wall strikes me as like a really well intentioned hippy type; when in God's green earth has it been a good idea to allow a five character statement change the truth values of nearly every for loop in a body of code? Perl always claimed it gave you enough rope to hang yourself, but this goes far, far beyond that. This is like building the scaffolding and marking it like "Young developers, play here! Ropes are fun!"
- irahul 15y ago> I am truly, truly horrified that this a language option in perl, although I'm not surprised. How about this in C(and thousand others): #define if while I am pretty sure I can find something to horrify you in almost any language.
- drivebyacct2 15y agoI hope it's obvious that it's a joke, but was the question serious is my concern.
- tkaemming 15y agoThe Dijkstra transcript referred to a bit deeper in the thread about why sequence numbering starts at zero is a tangentially interesting read: http://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html http://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EW...
- jemfinch 15y agoI specifically paged through the read to make sure that link had been given, and then came to this comment page to do the same thing. Few people seem to know that we have real and valid reasons for indexing from 0 instead of 1.
- sid6376 15y agoApologies if this appears dumb. After going through the link I still could not understand why is it ok to exclude the upper bound while including the lower bound? Is it because the lower bound is fixed as 0 is the smallest natural number? Or is there some other reason.
- ColinWright 15y agoDijkstra explains it pretty clearly - there are two main reasons. The first is so that the number of elements in the array/list/vector/collection is given by upper-lower. The second is so that successive intervals re-use the same number, the upper bound of one becoming the lower bound of the next. This is python we can have: L[:3], L[3:6], L[6:23], L[23:40], L[40:] With the repeated numbers we know that all elements of L have been included. Further, we know that given: L[start:end] ... then (provided L had at least "end" elements to start with) the resulting length is end-start. If you included the end point then the length would be end-start+1 which is fertile ground for fence-post errors.
- sid6376 15y agoThanks for the explanation.
- gtklocker 15y agoI don't want to live in this planet anymore.
- LeafStorm 15y agoRoberto Ierusalimschy has an interesting perspective on the zero vs. one concept: "Because people count from one, not zero. We do that in kindergarten, in music, when starting a race, when drawing up an agenda, everywhere. One, two, three, etc have their counterparts in every known language on earth. Zero, on the other hand, is an advanced concept. Humanity could prove that sqrt(2) is not a rational number centuries before anybody thought that a symbol for zero might be useful. A harder question would be "why do arrays in some other languages count from zero not one?" The answer for C is a good one: "so that * (A+k) and A[k] mean the same". For Python, the answer seems to be "because it's that way in C"." And: "Currently, many languages are 0-based due to influence from C. Ironically, none of them share the reason that made C 0-based (where a[e] means * (a+e))." (EDIT: I had to add spaces after the stars to prevent HN from italicizing a huge block of text.
- oxtopus 15y agoMeanwhile, some people do count up from zero. At least in numbering floors in a building. I know in Europe and other parts of the world the ground floor is the zeroth floor, and it goes up from there.
- LeafStorm 15y agoYeah, a lot of the buildings at my university are numbered that way. But not even in Europe would one count a stack of paper as "zero, one, two, three..."
- dkersten 15y agoNumerically, yes, but nobody calls it a "zeroth" floor. Rather, its "ground", "first", "second" (or G, 1, 2, 3...) so while ground is equivalent to zero, nobody actually says (or thinks) zero. At least, nowhere I've been.
- inportb 15y agoSo let's just call it the "ground" index. G = ground = 0; A[G], A[1], A[2], ...
- par 15y agoThe benevolent dictator for life has spoken!
- famousactress 15y agoGuido admits this is a joke later in the thread: (And to those taking the thread seriously: this is all in jest. We won't change the indexing base. The idea is so preposterous that the only kind of response possible is to laugh with it.) --Guido http://mail.python.org/pipermail/python-ideas/2011-September/011462.html http://mail.python.org/pipermail/python-ideas/2011-September...
- deleted 15y ago[deleted]
- deleted 15y ago[deleted]
- sagarun 15y agoWell, given Guido's endorsement, I think we need to change how these +1/-1 votes work. Clearly, +1 means what +0 used to mean. So you have to say +2 to vote in favor of something and -0 to vote against. I know it will be confusing during the transition period but it will be so much easier to use when we are done. Loved this response http://mail.python.org/pipermail/python-ideas/2011-September/011454.html http://mail.python.org/pipermail/python-ideas/2011-September...