How do you refer to an iterator in docs?

Roy Smith roy at panix.com
Thu Apr 19 08:21:20 EDT 2012


Let's say I have a function which takes a list of words.  I might write 
the docstring for it something like:

def foo(words):
   "Foo-ify words (which must be a list)"

What if I want words to be the more general case of something you can 
iterate over?  How do people talk about that in docstrings?  Do you say 
"something which can be iterated over to yield words", "an iterable over 
words", or what?

I can think of lots of ways to describe the concept, but most of them 
seem rather verbose and awkward compared to "a list of words", "a 
dictionary whose keys are words", etc.



More information about the Python-list mailing list