Re: A ListComp that maintains its own state

2005-02-09 Thread Carl Banks
Bernhard Herzog wrote: > Michael Spencer <[EMAIL PROTECTED]> writes: > > > So, here's factorial in one line: > > # state refers to list of state history - it is initialized to [1] > > # on any iteration, the previous state is in state[-1] > > # the expression also uses the trick of list.append() =

Re: A ListComp that maintains its own state

2005-02-09 Thread Michael Spencer
Bernhard Herzog wrote: Michael Spencer <[EMAIL PROTECTED]> writes: So, here's factorial in one line: # state refers to list of state history - it is initialized to [1] # on any iteration, the previous state is in state[-1] # the expression also uses the trick of list.append() => None # to both upd

Re: A ListComp that maintains its own state

2005-02-09 Thread Bernhard Herzog
Michael Spencer <[EMAIL PROTECTED]> writes: > So, here's factorial in one line: > # state refers to list of state history - it is initialized to [1] > # on any iteration, the previous state is in state[-1] > # the expression also uses the trick of list.append() => None > # to both update the state

Re: A ListComp that maintains its own state (Was: Re: turing machine in an LC)

2005-02-08 Thread Michael Spencer
Carl Banks wrote: Pay attention, chief. I suggested this days ago to remove duplicates from a list. from itertools import * [ x for (x,s) in izip(iterable,repeat(set())) if (x not in s,s.add(x))[0] ] ;) Sorry, I gave up on that thread after the first 10 Million* posts. Who knows what other pe

Re: A ListComp that maintains its own state (Was: Re: turing machine in an LC)

2005-02-08 Thread Carl Banks
Michael Spencer wrote: > > Jeremy Bowers <[EMAIL PROTECTED]> writes: > > > > > >>On Tue, 08 Feb 2005 17:36:19 +0100, Bernhard Herzog wrote: > >> > >>>Nick Vargish <[EMAIL PROTECTED]> writes: > >>> > "Xah Lee" <[EMAIL PROTECTED]> writes: > > >is it possible to write python code without

A ListComp that maintains its own state (Was: Re: turing machine in an LC)

2005-02-08 Thread Michael Spencer
Jeremy Bowers <[EMAIL PROTECTED]> writes: On Tue, 08 Feb 2005 17:36:19 +0100, Bernhard Herzog wrote: Nick Vargish <[EMAIL PROTECTED]> writes: "Xah Lee" <[EMAIL PROTECTED]> writes: is it possible to write python code without any indentation? Not if Turing-completeness is something you desire. Ber