strange SyntaxError

Attila Szabo trial at ugyvitelszolgaltato.hu
Sat Feb 26 00:32:32 EST 2005


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 bite.

This code was simplified, the lambda was part of a map,
and the exec line is different too, I just wrote
this to picture the situation, but it's ok now...
At first I was surprised, but I read a bit and it's clear now...

Thanks
--

A t t i l a :: trial at ugyvitelszolgaltato.hu :: S z a b o



More information about the Python-list mailing list