Python Feature Request: Add the "using" keyword which works like "with" in Visual Basic

Bjoern Schliessmann usenet-mail-0306.20.chr0n0ss at spamgourmet.com
Sat Apr 14 17:01:51 EDT 2007


jamadagni wrote:
> Bjoern Schliessmann wrote:

>> In more complex modules, when you are
>> looking for, e. g., self.myVar and anotherObject.myVar,
>> this "using" statement decreases readability and maintainability
>> (in full text searching). IMHO.
> 
> Why? Just search for self and you turn up using self. Just scan
> down (the block) and you get myVar. Similarly for
> anotherObject.myVar.

It seems to me that the biggest module you've ever written has less
than 100 lines.

> Of course, you lose the possibility of just searching for
> self.myVar -- something lost, something gained, IMHO.

So, the gain is the loss of something different? If you say so.

IMHO, the ability to find something quickly weighs much stronger
than needing to write 5 characters more. After all, working on the
code doesn't mean writing new stuff all the time, but modifying and
extending the existing code. A few characters more can enhance
readability vastly. IMHO.

Regards,


Björn

-- 
BOFH excuse #261:

The Usenet news is out of date




More information about the Python-list mailing list