Is there a better/simpler way to filter blank lines?

Ben Finney bignose+hates-spam at benfinney.id.au
Tue Nov 4 21:22:10 EST 2008


Steve Holden <steve at holdenweb.com> writes:

> I think there'd be no advantage to a sort method on a generator,
> since theoretically the last item could be the first required in the
> sorted sequence

Worse, generators don't necessarily *have* a finite set of items, and
there's no way in general of telling whether any particular generator
will have a “last item” without trying to get all the items. So it
would be actively harmful to provide such a method on generators, IMO.

-- 
 \              “Whatever you do will be insignificant, but it is very |
  `\                        important that you do it.” —Mahatma Gandhi |
_o__)                                                                  |
Ben Finney



More information about the Python-list mailing list