Christopher Subich wrote:

> Dear Zeus no.  Find can be defined as:
> def find(self, test=lambda x:1):
>     try:
>        item = (s for s in iter(self) if test(s)).next()
>     except StopIteration:
>        raise ValueError('No matching items in list')

I would prefer that a find() operation return as soon as it locates an 
item that passes the test. This generator version tests every item.

-- 
Robert Kern
[EMAIL PROTECTED]

"In the fields of hell where the grass grows high
  Are the graves of dreams allowed to die."
   -- Richard Harter

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

Reply via email to