[EMAIL PROTECTED] writes:

> But sometimes you don't need the elements of a given iterator, you
> just need to know how many elements it has.

AFAIK, the iterator protocol doesn't allow for that.

Bear in mind, too, that there's no way to tell from outside that an
iterater even has a finite length; also, many finite-length iterators
have termination conditions that preclude knowing the number of
iterations until the termination condition actually happens.

-- 
 \       "When a well-packaged web of lies has been sold to the masses |
  `\    over generations, the truth will seem utterly preposterous and |
_o__)                 its speaker a raving lunatic."  -- Dresden James |
Ben Finney

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

Reply via email to