A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2001-April/087766.html below:

With or Using

With or Using With or UsingTim Howarth tim at worthy.demon.co.uk
Tue Apr 17 04:16:11 EDT 2001
Being lazy, I wondered if something like the following was possible in
Python?

jim=person()

Rather than typing jim each time,

jim.born=1960
jim.haircolour='Brown'
jim.eyecolour='Green'

Have a "with" or "using" block,

with jim:
    born=1960
    haircolour='Brown'
    eyecolour='Green'

or
using jim:
    born=1960



-- 
___
 |im    ---- ARM Powered ----

More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4