A RetroSearch Logo

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

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-March/043631.html below:

[Python-Dev] Re: method decorators (PEP 318)

[Python-Dev] Re: method decorators (PEP 318) [Python-Dev] Re: method decorators (PEP 318)Greg Ewing greg at cosc.canterbury.ac.nz
Sun Mar 28 22:15:23 EST 2004
Casey Duncan <casey at zope.com>:

> For some reason I thought there was a philosophical objection to 'with'
> in Python. Must have been an urban myth I guess.

I think it's considered to have quite a low priority,
since it wouldn't buy you much. Binding a nice short
temporary name to the with-ed object is almost as
concise and arguably clearer.

By the way, I happen to think there are better uses
to which the word 'with' could be put, e.g. the
suggestion of making

  with lock(foo):
    do_something()

mean something like

  _x = lock(foo)
  _x.__enter__()
  try:
    do_something()
  finally:
    _x.__exit()

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg at cosc.canterbury.ac.nz	   +--------------------------------------+

More information about the Python-Dev 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