How do you refer to an iterator in docs?

Chris Angelico rosuav at gmail.com
Thu Apr 19 08:46:26 EDT 2012


On Thu, Apr 19, 2012 at 10:21 PM, Roy Smith <roy at panix.com> wrote:
> 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?

"Foo-ify an iterable yielding words" or "an iterable of words" is what
I'd use, others may have other preferences. Possibly even "Foo-ify a
series of words" and have a few examples that make it clear that you
mean a list/tuple/iterable.

ChrisA



More information about the Python-list mailing list