Re: [Python-Dev] PEP for Better Control of Nested Lexical Scopes

2006-02-22 Thread Brendan Simons
On 22-Feb-06, at 9:28 PM, [EMAIL PROTECTED] wrote:On 21-Feb-06, at 11:21 AM, Almann T. Goo" <[EMAIL PROTECTED]> wrote:Why not just use a class?def incgen(start=0, inc=1) :    class incrementer(object):      a = start - inc      def __call__(self):         self.a += inc         return self.a    retu

Re: [Python-Dev] PEP for Better Control of Nested Lexical Scopes

2006-02-22 Thread Brendan Simons
On 21-Feb-06, at 11:21 AM, Almann T. Goo" <[EMAIL PROTECTED]> wrote:Why not just use a class?def incgen(start=0, inc=1) :    class incrementer(object):      a = start - inc      def __call__(self):         self.a += inc         return self.a    return incrementer()a = incgen(7, 5)for n in range(10)