mpeuser at web.de
Thu Aug 7 10:35:59 CEST 2003
"Terry Reedy" <tjreedy at udel.edu> schrieb im Newsbeitrag
news:tpKdnUQ75tjOZKyiU-KYuQ at comcast.com...
> "Jeremy Fincher" <email@example.com> wrote in message
> news:bgsqj5$228$1 at news.cis.ohio-state.edu...
> > Sometimes I find myself simply wanting the length of an iterator.
> An iterator is a function/method that traverses (or possibly
> generates) a seqeuence. The sequence has a length (actual or
> potential) but the iterator does not.
Very well explained. There are lots of usefull generators with unlimited
- random generators
- def achilles():
- def schoenberg():
for i in cycle:
There is no way to determined, whether such generartors will come to an
end - The Halting Problem for Turing Machines ;-)
Thus there will never be a safe len(iterator).
More information about the Python-list