Re: Conventions for dummy name
- From: Torsten Bronger <bronger@xxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 10 Jan 2008 09:39:51 +0100
Hallöchen!
Ben Finney writes:
"Diez B. Roggisch" <deets@xxxxxxxxxxxxx> writes:
The underscore is used as "discarded" identifier. So maybe
for _ in xrange(10):
...
The problem with the '_' name is that it is already well-known and
long-used existing convention for an entirely unrelated purpose:
in the 'gettext' i18n library, the '_' function to get the
locally-translated version of a text string.
Right, that's because I've used "__" where not all returning values
are interesing to me such as
a, b, __ = function_that_returns_three_values(x, y)
However, in loops, I prefer real names, even if the loop variable
isn't used outside.
Tschö,
Torsten.
--
Torsten Bronger, aquisgrana, europa vetus
Jabber ID: bronger@xxxxxxxxxx
(See http://ime.webhop.org for further contact info.)
.
- Follow-Ups:
- SV: Conventions for dummy name
- From: David.Reksten
- SV: Conventions for dummy name
- References:
- for loop without variable
- From: erik gartz
- Re: for loop without variable
- From: Diez B. Roggisch
- Conventions for dummy name (was: for loop without variable)
- From: Ben Finney
- for loop without variable
- Prev by Date: Re: Python too slow?
- Next by Date: Re: Learning Python via a little word frequency program
- Previous by thread: Re: Conventions for dummy name (was: for loop without variable)
- Next by thread: SV: Conventions for dummy name
- Index(es):
Relevant Pages
|