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.  The with statement's binding targets all have to support
the protocol, which means a lot of different libraries need redesign.
You can't do that with macros.  Macros can handle some narrow special
cases such as file-like objects, handled in Python with
contextlib.closing.

That said, the with statement was missing from Python for much too
long, since users were happy to rely on reference counting.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to