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

With or Using

With or Using With or UsingRemco Gerlich scarblac at pino.selwerd.nl
Tue Apr 17 17:36:27 EDT 2001
Tim Howarth <tim at worthy.demon.co.uk> wrote in comp.lang.python:
> In message <3ADC5AE1.53C3C4FE at alcyone.com>
>           Erik Max Francis <max at alcyone.com> wrote:
 > > It saves a small amount of typing (and not very much) at the expense of
> > a lack of clarity and the addition of ambiguity.
> 
> I thought with Python's block indenting it would be pretty clear what
> was being referred to.

Consider:

a = A()
with a:
   b = c
   
What does c refer to? Is it a.c or some global c? There's no way to tell.
It might even change from time to time. I'm assuming that c would refer to
a.c iff a has an attribute called c, and to another variable otherwise. But
even the fact that I have to make such an assumption shows that this should
not be Python... Be explicit as much as possible.

-- 
Remco Gerlich

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