[Python-Dev] defmacro (was: Anonymous blocks)

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Apr 26 07:48:11 CEST 2005


Jim Jewett wrote:

> defmacro myresource(filename):
>     <make explicit calls to named callback "functions", but 
>       within the same locals() scope.>
> 
> with myresource("thefile"):
>     def reader(): 
>         ...
>     def writer():
>         ...
>     def fn():
>         ....

-1. This is ugly.

-- 
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg.ewing at canterbury.ac.nz	   +--------------------------------------+


More information about the Python-Dev mailing list