On Thu, Mar 6, 2014 at 3:03 PM, Skip Montanaro <s...@pobox.com> wrote:
> On Thu, Mar 6, 2014 at 2:51 PM, Nelle Varoquaux
> <nelle.varoqu...@gmail.com> wrote:
> > The convention is to use a simple _.
> >
> > mode, _, dev, nlink, uid, gid, size, _, _, _ = os.stat("/etc/hosts")
>
> Which is "pylint-compliant", but removes any description to future
> readers (who might decide to use them) what the meaning of those
> various unused values are.
>
Just to bikeshed a bit: There are common cases where a bare "_" really is a
good solution. E.g.
something = [object() for _ in range(10)]
It's immediately clear a) what "_" is, and b) that it's unused. "for _i in
range(10)" is more jarring in that particular case, i.m.h.o.
I do agree that "_descriptive_name" is better in many situations.
I'd just argue for a "prefer this, but use your best judgement" type
guideline rather than a strict rule.
Then again, I'm not actively involved in development, so I probably
shouldn't hold too much of an opinion either way.
Cheers,
-Joe
------------------------------------------------------------------------------
Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works.
Faster operations. Version large binaries. Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel