code blocks in Python

Hung Jung Lu hungjunglu at yahoo.com
Mon Nov 24 20:05:58 CET 2003


Skip Montanaro <skip at pobox.com> wrote in message news:<mailman.1023.1069685306.702.python-list at python.org>...
> You ignored Jeff's primary questions.  What are the semantics of a named
> code block such as you propose?  What if it's executed in a context which
> doesn't contain the variables it uses?  What expressive power does it give
> to Python that Python doesn't currently have?

And you ignored my reply. :)

I will repeat once more: the compile() function exists and works in
Python. Please try the compile() function first before posting. Thank
you very much! Please people, how many times do I have to say it???
Everything you want to know about the semantics, the what ifs (like:
"what if it's executed in a context which doesn't contain the
variables it uses?"), is already answered when you try to spend 30
seconds using the compile() function. If you can't spend 30 seconds
trying out the compile() function, then I am sorry I can't help you!
:)

As for the expressive power, it'll be part of PEP, if there is a PEP.
That part I don't worry. But first let us collect complaints and get
to know if there are previous attempts.

regards,

Hung Jung




More information about the Python-list mailing list