On Friday 23 July 2010, Duncan Gibson wrote:
> > I've seen people writting
> >
> > timestamp, name, _, permission = get_next_entry()
> >
> > The drawback is that your reader loose the information that you're
> > expecting fsize as 3rd element. It may be worth it though.
> > You just have to make sure that '_' is identified as a dummy variable
> > in your pylint rules.
>
> I've modified my .pylintrc file to have the following:
>
> dummy-variables-rgx=(_|dummy|(unused.*))
>
> which would allow me to have:
>
> timestamp, name, dummy, permission = get_next_entry()
>
> or the self-documenting:
>
> timestamp, name, unused_fsize, permission = get_next_entry()
I have done something similar:
In pylintrc:
dummy-variables-rgx=[^_]*_
In the source code:
timestamp, name, fsize_, permission = get_next_entry()
It really helps code readability to give names to things you untuple, even
if you don't use all of them.
Bye,
Maarten
_______________________________________________
Python-Projects mailing list
[email protected]
http://lists.logilab.org/mailman/listinfo/python-projects