[Python-Dev] 'With' context documentation draft (was Re: Terminology for PEP 343

Guido van Rossum gvanrossum at gmail.com
Fri Jul 8 09:53:14 CEST 2005


On 7/7/05, Walter Dörwald <walter at livinglogic.de> wrote:
> What is still unspecified (or at least not explicitely mentioned) in
> the PEP is the lifetime of VAR in:
> 
>          with EXPR as VAR:
>              BLOCK

It is specified well enough IMO -- you're supposed to take the
translation into basic Python seriously. That translation specifies a
simple assignment to VAR, and that's what I meant (and what I'm sure
most folks understood). IOW VAR lives in the surrounding scope,
overwrites a previous value, and survives past the with-statement
(unless it is set inside of course).

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-Dev mailing list