SV: Conventions for dummy name

David.Reksten at sweco.no David.Reksten at sweco.no
Thu Jan 10 07:39:52 EST 2008


Torsten Bronger writes:
>David.Reksten at sweco.no writes:
>
>> Torsten Bronger wrote:
>>
>>> [...]
>>>
>>> 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)
>>
>> Variable name "dummy" serves the same purpose, such as:
>>
>>     a, b, dummy = function_that_returns_three_values(x, y)
>
>Granted, but my rationale is that "__" is less visible in the source
>code, so there is more emphasis on the actually interesting
>variables.

I guess it's a matter of preference. Personally, I find "dummy" to be more
explicit, and hence more readable for those that that will read my code
later. YMMV.

Regards,
.david



More information about the Python-list mailing list