Tim Johnson writes:
> If I use
> for dummy in range(mylimit):
>
> ## or
> for _ in range(mylimit):
>
> I get no complaint from pychecker.
> I would welcome comments on best practices for this issue.
I have argued in the past against overloading the name ‘_’ for this
http:/
* Tim Johnson [110613 07:58]:
>
> :) I expect to be edified is so many ways, some
> of them unexpected.
Thanks for all of the responses and for those which might come
later. I'm going to stick with the convention of using a variable
beginning with `dummy' and stick that in my snippet gene
On Tue, Jun 14, 2011 at 2:15 AM, Steven D'Aprano
wrote:
> On Tue, 14 Jun 2011 01:55:04 +1000, Chris Angelico wrote:
>> _ is special to IDLE.
>
> Not just IDLE. Also the vanilla Python command line interpreter. In fact,
> you can even find the code that controls it:
Sorry, my bad! I should have sa
On Tue, Jun 14, 2011 at 2:02 AM, Steven D'Aprano
wrote:
> On Mon, 13 Jun 2011 07:37:02 -0800, Tim Johnson wrote:
>
>> Consider the following code:
> [...]
>
> You know Tim, if you hadn't blocked my email address in a fit of pique
> over something that didn't even involve you, you would have seen m
On Tue, 14 Jun 2011 01:55:04 +1000, Chris Angelico wrote:
> On Tue, Jun 14, 2011 at 1:37 AM, Tim Johnson
> wrote:
>> On a related note: from the python interpreter if I do
> help(_)
>> I get
>> Help on bool object:
>>
>> class bool(int)
>> | bool(x) -> bool
>> ..
>> I'd welcome commen
On Mon, 13 Jun 2011 07:37:02 -0800, Tim Johnson wrote:
> Consider the following code:
[...]
You know Tim, if you hadn't blocked my email address in a fit of pique
over something that didn't even involve you, you would have seen my
answer to your question on the tu...@python.org mailing list yes
On Tue, Jun 14, 2011 at 1:37 AM, Tim Johnson wrote:
> On a related note: from the python interpreter if I do
help(_)
> I get
> Help on bool object:
>
> class bool(int)
> | bool(x) -> bool
> ..
> I'd welcome comments on this as well.
_ is special to IDLE.
>>> 1+2
3
>>> _
3
It's the
On Jun 13, 2011, at 11:37 AM, Tim Johnson wrote:
> NOTE: I see much on google regarding unused local variables,
> however, doing a search for 'python _' hasn't proved fruitful.
Yes, Google's not good for searching punctuation. But 'python underscore dummy
OR unused' might work better.
> On a
Consider the following code:
for i in range(mylimit):
foo()
running pychecker gives me a
"""
Local variable (i) not used
"""
complaint.
If I use
for dummy in range(mylimit):
## or
for _ in range(mylimit):
I get no complaint from pychecker.
I would welcome comments on