Carl Banks <[EMAIL PROTECTED]> writes: > 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?
It's not a documented standard, to my knowledge. > 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. It has been in this forum that the use of the name '_' for "don't care about the value" was deprecated, since that name is already overloaded with other meanings. > 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. I think it's far superior to '_'. I'd be just as happy with any other name that explicitly distinguishes itself for this purpose. > If a value isn't used, then I think the most clear name for it is > "unused". Sounds good to me. Now we merely need to convince the world. -- \ “Software patents provide one more means of controlling access | `\ to information. They are the tool of choice for the internet | _o__) highwayman.” —Anthony Taylor | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list