Message61205
A class may wish to define __len__() despite that it
doesn't know how many objects iterating an instance
may produce. The docs should give advice for this
case. They should also explicitly point out that the
result of __len__() is generally taken to be a _hint_
(functions like map(), tuple(), etc., may preallocate
space based on __len__()'s result, but adjust to the
actual number of objects produced).
Tail end of a related thread:
<http://mail.zope.org/pipermail/zope3-dev/2005-
September/015599.html> |
|
Date |
User |
Action |
Args |
2008-01-20 09:59:40 | admin | link | issue1283110 messages |
2008-01-20 09:59:40 | admin | create | |
|