Python Feature Request: Add the "using" keyword which works like "with" in Visual Basic
Mel Wilson
mwilson at the-wire.com
Sat Apr 14 11:37:59 EDT 2007
samjnaa at gmail.com wrote:
> 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 syntactic sugar for:
>
> quitCommandButton.enabled=true
> quitCommandButton.default=true
>
> This can be very useful especially in GUI programming when we have to
> type the same object name in line-after-line.
q = quitCommandButton
q.enabled = true
q.default = true
Mel.
More information about the Python-list
mailing list