ignoring a part of returned tuples

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Wed Jul 4 10:00:50 EDT 2007


On Wed, 04 Jul 2007 05:25:01 -0700, noamtm wrote:

> On Jul 4, 11:29 am, Bruno Desthuilliers <bruno.
> 42.desthuilli... at wtf.websiteburo.oops.com> wrote:
> 
>> A common idiom is to use '_' for unused values, ie:
>>
>> for (dirpath, _, filenames) in os.walk(...):
> 
> That's what I need - this avoids PyLint telling me that I have an
> unused variable, and also makes it clear that this value is not used.

Pylint also "allows" the name `dummy` without complaining.  That makes it
even clearer and doesn't clash with the meaning of `_` when `gettext` is
used.

It's possible to configure many checks in Pylint.  For this check it's
possible to give a regular expression for names you don't care if they are
unused.

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list