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/080404.html below:

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?Nick Coghlan ncoghlan at gmail.com
Sun Jun 15 07:14:41 CEST 2008
Cesare Di Mauro wrote:
> I agree: Python's with statement does have a completely different
> meaning of the same Pascal & Co 's statement.
> 
> 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 isn't that a Pascal-with-style statement can't be achieved, it's that 
it is pointless syntactic sugar in Python. Just use o = 
long_complicated_object_name instead.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org
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