Ben Cartwright wrote: > Definitely go for (1). The Morris sequence is a great candidate to > implement as a generator. As a generator, it will be more flexible and > efficient than (2).
Actually I was just thinking about this and it seems like, at least for my purpose (to simply return a list of numbers), I don't need a generator. My understanding of a generator is that you do something to each yielded value before returning to the generator (so that you might not return at all), but since I'm not handling the individual numbers, just getting a list, it seems I don't need them to be yielded. Of course, a generator would allow the process to be done over and over, I suppose, which is what I wanted, I just couldn't figure out how to keep using the new values. -- http://mail.python.org/mailman/listinfo/python-list