[EMAIL PROTECTED] a écrit :
> I use generators a lot. E.g.
> 
> 
> def gen_words(text)
>   ... parse text ...
>   yield each word in text
> 
> for word in gen_words(text):
>   print word
> 
> 
> I don't like the name gen_xxx() very much.

Nor do I.

> Looking for some inspiration
> to name generators. Here are some of my ideas:
> 
>   enumerate_words
>   gen_words
>   generate_words
>   parse_words
>   walk_words
> 
> Any idea? D

Any of these names have different (somewhat implied) semantic to me. I'd 
expect enunmerate_words to yield (order, word) pairs, parse_words to 
yield tokens, walk_words to traverse a tree of words, etc

As you see, this is much about what it does than what it is. And FWIW, 
do you prefix function names s with fun_ ?

> you have a naming convention for generators?

No.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to