Re: strange SyntaxError

2005-02-26 Thread Scott David Daniels
Attila Szabo wrote: 2005, Feb 25 -> Scott David Daniels wrote : Attila Szabo wrote: >>...lambda x: 'ABC%s' % str(x) ... OK, to no real effect, in main you define an unnamed function that you can never reference. Pretty silly, but I'll bite. This code was simplified, the lambda was part of a m

Re: strange SyntaxError

2005-02-25 Thread Attila Szabo
2005, Feb 25 -> Scott David Daniels wrote : > Attila Szabo wrote: > >Hi, > >def main(): > >lambda x: 'ABC%s' % str(x) > >for k in range(2): exec('print %s' % k) > OK, to no real effect, in main you define an unnamed function that > you can never reference. Pretty silly, but I'll bi

Re: strange SyntaxError

2005-02-25 Thread Terry Reedy
"Attila Szabo" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > I wrote this sample piece of code: > > def main(): >lambda x: 'ABC%s' % str(x) >for k in range(2): exec('print %s' % k) > > main() > > With the lambda line, I get this: > SyntaxError: unqualified

Re: strange SyntaxError

2005-02-25 Thread Scott David Daniels
Attila Szabo wrote: Hi, def main(): lambda x: 'ABC%s' % str(x) for k in range(2): exec('print %s' % k) OK, to no real effect, in main you define an unnamed function that you can never reference. Pretty silly, but I'll bite. Next you run run a loop with exec looking like you think i