Bruce Leban schrieb:
On Fri, Aug 29, 2008 at 1:47 PM, David Blaschke <email@example.com mailto:firstname.lastname@example.org> wrote:
This idea elif x == funky_empty: result = 'no data' Can be accomplished with if not len(items): result = 'no data' which means that part of the proposal can be scratched IMHO.
Not quite: len(items) requires iterating across the entire list which may not be necessary or desirable. Plus you may need an intermediate variable to store it. I think that's inferior.
This is moot anyway: in general, iterators have no __len__().