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/2008-June/080393.html below:

[Python-Dev] Python FAQ: Why doesn't Python have a "with" statement?

[Python-Dev] Python FAQ: Why doesn't Python have a "with" statement? [Python-Dev] Python FAQ: Why doesn't Python have a "with" statement?Greg Ewing greg.ewing at canterbury.ac.nz
Sun Jun 15 01:42:14 CEST 2008
Cesare Di Mauro wrote:

> However, I don't agree with the FAQ on this point. I think that a
 > Pascal-like with statement can be achieved, even with a dynamic
 > language such as Python, and in a simple way.

It's not so much a matter of whether it *can* be done, but
whether there's any substantial need for it. I don't believe
there is in Python, because you can always put a reference
to the target object into a succinctly-named local and access
it through that.

You can't always do that in Pascal, because it provides no
way of obtaining a pointer a record that wasn't heap-allocated.

-- 
Greg
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