On Mar 6, 2014 10:24 PM, Skip Montanaro s...@pobox.com wrote:
On Thu, Mar 6, 2014 at 3:13 PM, Nelle Varoquaux
nelle.varoqu...@gmail.com wrote:
If I need to understand what exactly os.stat returns, I just read the
documentation, and not rely on some possibly misleading variable
names.
Hello everybody
Stupid simple question
Is there a policy/tradition/convention to name unused variables inside the code?
Even better, if I see '''var''', can I replace it with '''_var''' and
nobody is going to complain?
I use eclipse and it complains about that (I like that it warns me). I
just
On 2014/03/06 3:47 AM, Federico Ariza wrote:
Hello everybody
Stupid simple question
Is there a policy/tradition/convention to name unused variables inside the
code?
Not yet.
Even better, if I see '''var''', can I replace it with '''_var''' and
nobody is going to complain?
That might be
On Thu, Mar 6, 2014 at 7:47 AM, Federico Ariza ariza.feder...@gmail.com wrote:
Stupid simple question
Is there a policy/tradition/convention to name unused variables inside the
code?
While Eric indicates there is no policy, for the Python parts of your
code, I recommend you follow whatever
Hi,
I don't think a leading _ is the way to go, because that's a common
convention for internal class variables--property variables that you don't
intend to be part of any supported API.
Personally, I've always just called things like this junk or unused,
but I know that's not as nice as having a
On Thu, Mar 6, 2014 at 2:38 PM, Ryan May rma...@gmail.com wrote:
I don't think a leading _ is the way to go, because that's a common
convention for internal class variables--property variables that you don't
intend to be part of any supported API.
But leading underscores like this are only
On 6 March 2014 21:47, Skip Montanaro s...@pobox.com wrote:
On Thu, Mar 6, 2014 at 2:38 PM, Ryan May rma...@gmail.com wrote:
I don't think a leading _ is the way to go, because that's a common
convention for internal class variables--property variables that you don't
intend to be part of any
Skip,
That's exactly what I was referring to.
I check PEP8 and there is no mention of unused variables.
On Thu, Mar 6, 2014 at 3:47 PM, Skip Montanaro s...@pobox.com wrote:
On Thu, Mar 6, 2014 at 2:38 PM, Ryan May rma...@gmail.com wrote:
I don't think a leading _ is the way to go, because
Nelle
Is that written somewhere?
On Thu, Mar 6, 2014 at 3:51 PM, Nelle Varoquaux
nelle.varoqu...@gmail.com wrote:
On 6 March 2014 21:47, Skip Montanaro s...@pobox.com wrote:
On Thu, Mar 6, 2014 at 2:38 PM, Ryan May rma...@gmail.com wrote:
I don't think a leading _ is the way to go, because
I am with Eric, I find the bare `_` to be jarring and in some
fonts/color schemes can blend in too much. I advocate for `_name`.
Just because the variable isn't used now, does not mean it won't be
used later and having sensible variable names on them can't hurt.
Tom
On Thu, Mar 6, 2014 at 3:53
On 6 March 2014 21:53, Federico Ariza ariza.feder...@gmail.com wrote:
Nelle
Is that written somewhere?
I think the convention originated from google's python style guide.
Pylint should warn you if you don't use this convention.
On Thu, Mar 6, 2014 at 3:51 PM, Nelle Varoquaux
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
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
On Thu, Mar 6, 2014 at 3:13 PM, Nelle Varoquaux
nelle.varoqu...@gmail.com wrote:
If I need to understand what exactly os.stat returns, I just read the
documentation, and not rely on some possibly misleading variable
names.
Despite our wish that it wasn't so, it is likely that there is far
more
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
On Thu, Mar 6, 2014 at 1:23 PM, Skip Montanaro s...@pobox.com wrote:
Despite our wish that it wasn't so, it is likely that there is far
more undocumented than documented code out in the wild, or behind
firewalls where we can't see it.
Well, then you're hosed anyway -- relying on the name of
16 matches
Mail list logo