Clever hack or code abomination?

Terry Reedy tjreedy at udel.edu
Thu Dec 1 21:49:07 EST 2011


On 11/30/2011 10:49 PM, Matt Joiner wrote:
> def possible_names():
>      yield "foo"
>      for i in range(20):
>          yield "foo-" + str(i)

This is my favorite -- crystal clear with only the variable part 
variable. And it works in both 2.x and 3.x.

-- 
Terry Jan Reedy




More information about the Python-list mailing list