On Jun 26, 10:10 am, Paul Rubin <http://[EMAIL PROTECTED]> wrote:
> Andy Freeman <[EMAIL PROTECTED]> writes:
> > Compare that with what a programmer using Python 2.4 has to do if
> > she'd like the functionality provided by 2.5's with statement.  Yes,
> > with is "just syntax", but it's extremely useful syntax, syntax that
> > can be easily implemented with lisp-style macros.
>
> Not really.

Yes really, as the relevant PEP shows.  The "it works like" pseudo-
code is very close to how it would be defined with lisp-style macros.

> The with statement's binding targets all have to support
> the protocol, which means a lot of different libraries need redesign.

That's a different problem, and it's reasonably solvable for anyone
who wants to use the roll-your-own with while writing an application
running under 2.4.  (You just add the relevant methods to the
appropriate classes.)

The big obstacle is the syntax of the with-statement.  There's no way
to define it in python with user-code.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to