From: Mark Lawrence on 17 Jul 2010 04:57 On 17/07/2010 03:59, python(a)bdurham.com wrote: > Tim, > >> 2.x?! You were lucky. We lived for three months with Python 1.x in a septic tank. We used to have to get up at six in the morning, write our 1.x code using ed, eat a crust of stale bread, go to work down in machine language, fourteen hours a day, > week-in week-out, for sixpence a week, and when we got home our Dad > would thrash us to sleep wi' his belt... > > Luxury. Our computers only had 256 bytes[1] of RAM and We had to enter > our code, in the dark, using loose binary toggle switches with poor > connections. We used to have to get out of the lake at three o'clock in > the morning, clean the lake, eat a handful of hot gravel, go to work at > the mill every day for tuppence a month, come home, and Dad would beat > us around the head and neck with a broken bottle, if we were LUCKY! > > Cheers, > Malcolm > > [1] http://incolor.inebraska.com/bill_r/elf/html/elf-1-33.htm I'm just envisaging a "Paper Tape Repairman" sketch. Kindest regards. Mark Lawrence.
From: Thomas Jollans on 17 Jul 2010 06:39 On 07/17/2010 10:03 AM, Steven D'Aprano wrote: > On Fri, 16 Jul 2010 21:23:09 -0500, Tim Chase wrote: > >>> Is anyone /still/ using Python 2.x? ;-) >> >> 2.x?! You were lucky. We lived for three months with Python 1.x in a >> septic tank. We used to have to get up at six in the morning, write our >> 1.x code using ed, > > You got to use ed? Oh, we *dreamed* of using an editor! We had to edit > the sectors on disk directly with a magnetised needle. A rusty, blunt > needle. > You try and tell the young people of today that, and they won't believe you.
From: Paul McGuire on 17 Jul 2010 09:57 On Jul 16, 12:01 pm, Peng Yu <pengyu...(a)gmail.com> wrote: > I mean to get the man page for '[' like in the following code. > > x=[1,2,3] > > But help('[') doesn't seem to give the above usage. > > ########### > Mutable Sequence Types > ********************** > > List objects support additional operations that allow in-place > modification of the object. Other mutable sequence types (when added > to the language) should also support these operations. Strings and > tuples are immutable sequence types: such objects cannot be modified > once created. The following operations are defined on mutable sequence > types (where *x* is an arbitrary object): > ... > ########## > > I then checked help('LISTLITERALS'), which gives some description that > is available from the language reference. So '[' in "x=[1,2,3]" is > considered as a language feature rather than a function or an > operator? > > ############ > List displays > ************* > > A list display is a possibly empty series of expressions enclosed in > square brackets: > > list_display ::= "[" [expression_list | list_comprehension] "]" > list_comprehension ::= expression list_for > list_for ::= "for" target_list "in" old_expression_list > [list_iter] > old_expression_list ::= old_expression [("," old_expression)+ [","]] > list_iter ::= list_for | list_if > list_if ::= "if" old_expression [list_iter] > ..... > ########### > -- > Regards, > Peng Also look for __getitem__ and __setitem__, these methods defined on your own container classes will allow you to write "myobject['x']" and have your own custom lookup code get run. -- Paul
From: Gary Herron on 17 Jul 2010 12:38 On 07/17/2010 01:03 AM, Steven D'Aprano wrote: > On Fri, 16 Jul 2010 21:23:09 -0500, Tim Chase wrote: > > >>> Is anyone /still/ using Python 2.x? ;-) >>> >> 2.x?! You were lucky. We lived for three months with Python 1.x in a >> septic tank. We used to have to get up at six in the morning, write our >> 1.x code using ed, >> > You got to use ed? Oh, we *dreamed* of using an editor! We had to edit > the sectors on disk directly with a magnetised needle. A rusty, blunt > needle. > Along those lines, there's this -- one of my favorite comics: http://xkcd.com/378/ and unrelated to the thread but still about python: http://xkcd.com/353/ Gary Herron
From: Thomas Jollans on 17 Jul 2010 13:16
On 07/17/2010 06:38 PM, Gary Herron wrote: > On 07/17/2010 01:03 AM, Steven D'Aprano wrote: >> On Fri, 16 Jul 2010 21:23:09 -0500, Tim Chase wrote: >> >> >>>> Is anyone /still/ using Python 2.x? ;-) > http://xkcd.com/353/ There we have the most important difference between Python 2 and 3: in the latter, "import antigravity" actually works. |