Conventions for dummy name

Torsten Bronger bronger at
Thu Jan 10 09:39:51 CET 2008


Ben Finney writes:

> "Diez B. Roggisch" <deets at> 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.


Torsten Bronger, aquisgrana, europa vetus
                                      Jabber ID: bronger at
               (See for further contact info.)

More information about the Python-list mailing list