Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #7576

Re: dummy, underscore and unused local variables

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!selfless.tophat.at!news.glorb.com!news-xfer.nntp.sonic.net!news.astraweb.com!border5.newsrouter.astraweb.com!not-for-mail
From Ben Finney <ben+python@benfinney.id.au>
Newsgroups comp.lang.python
Subject Re: dummy, underscore and unused local variables
References <mailman.175.1307979321.11593.python-list@python.org>
X-Public-Key-ID 0xAC128405
X-Public-Key-Fingerprint 517C F14B B2F3 98B0 CB35 4855 B8B2 4C06 AC12 8405
X-Public-Key-URL http://www.benfinney.id.au/contact/bfinney-pubkey.asc
X-Post-From Ben Finney <bignose+hates-spam@benfinney.id.au>
Date Tue, 14 Jun 2011 10:39:36 +1000
Message-ID <87vcw9tfef.fsf@benfinney.id.au> (permalink)
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)
Cancel-Lock sha1:MBLF+MY6DE9NPj+JmK5q6oRLggo=
MIME-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 8bit
Lines 22
Organization Unlimited download news at news.astraweb.com
NNTP-Posting-Host a5340fc4.news.astraweb.com
X-Trace DXC=6AUKlV?BkhClVZHQGRZg_EL?0kYOcDh@JW\:Hm@YlDbJ83@2Tm:<S0HUGD@iN[Hd?ORFc4fCOTilL
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:7576

Show key headers only | View raw


Tim Johnson <tim@johnsons-web.com> 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
<URL:http://mail.python.org/pipermail/python-list/2008-January/523777.html>
since it has other, unrelated, meanings already established.

Other responses in that thread are also useful.

-- 
 \      “I find the whole business of religion profoundly interesting. |
  `\     But it does mystify me that otherwise intelligent people take |
_o__)                                    it seriously.” —Douglas Adams |
Ben Finney

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

dummy, underscore and unused local variables Tim Johnson <tim@johnsons-web.com> - 2011-06-13 07:37 -0800
  Re: dummy, underscore and unused local variables Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-06-13 16:02 +0000
    Re: dummy, underscore and unused local variables Chris Angelico <rosuav@gmail.com> - 2011-06-14 02:28 +1000
  Re: dummy, underscore and unused local variables Ben Finney <ben+python@benfinney.id.au> - 2011-06-14 10:39 +1000

csiph-web