On May 11, 6:44 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > In such cases, the name 'dummy' is conventionally bound to the items > from the iterator, for clarity of purpose:: > > for dummy in range(10): > # do stuff that makes no reference to 'dummy'
Is this documented? I've never heard of this convention. It's not PEP 8, and I've never seen consistent usage of any name. I'd be interested in knowing where you read that this was a convention, or in what subcommunities it's a convention in. I think dummy is a terrible name to use for this, since in no other usage I can think of does the word "dummy" suggest something isn't used. In fact, quite the opposite. For example, the dummy_threads module is most definitely used; the word dummy means that it's stripped down. Based on that, your usage of the symbol dummy above would suggest to me that it's a value used in lieu of something else (such as a calculated value). In mathematics, a dummy argument another name for the independent variable of a function (or more accurately, the symbol used to represent it), which also doesn't match your usage. If a value isn't used, then I think the most clear name for it is "unused". Carl Banks -- http://mail.python.org/mailman/listinfo/python-list