On 6 March 2014 22:03, 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.

The opposite also holds: personally, my brain shuts down when I see an
underscore, because I know those values aro no use in this context. If
there are variables names that aren't use, it confuses me, and I try
to understand where they are use.
If I need to understand what exactly os.stat returns, I just read the
documentation, and not rely on some possibly misleading variable
names.

 We can debate hours whether these conventions are justified or not.
It all comes down to what's your habit.

>From the google style guide (pylint section):

Unused argument warnings can be suppressed by using `_' as the
identifier for the unused argument or prefixing the argument name with
`unused_'. In situations where changing the argument names is
infeasible, you can mention them at the beginning of the function. For
example:

def foo(a, unused_b, unused_c, d=None, e=None):
    _ = d, e

return a

>
> Skip

------------------------------------------------------------------------------
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

Reply via email to