Python Feature Request: Add the "using" keyword which works like "with" in Visual Basic

Paul Boddie paul at
Mon Apr 16 18:11:42 CEST 2007

samjnaa at wrote:
> Please check for sanity and approve for posting at python-dev.

Technically, you can post it yourself to python-dev, but you'll just
get bounced back here to discuss it with us. ;-)

> In Visual Basic there is the keyword "with" which allows an object-
> name to be declared as governing the following statements. For
> example:
> with quitCommandButton
>  .enabled = true
>  .default = true
> end with

This is how the discussion started for the current "with" statement,
although it ended up doing something somewhat different.


> Now I hear that the word "with" is being discussed for a different
> purpose in Py 3 as a result of a PEP and I don't want to conflict with
> that.

The "with" keyword appears in 2.5 onwards.


More information about the Python-list mailing list