[Python-ideas] data structures should have an .any() method

Greg Ewing greg.ewing at canterbury.ac.nz
Mon Sep 7 02:39:28 CEST 2009


Steven D'Aprano wrote:

> If you're expecting "exactly one result", then surely it should be an 
> error to receive more than one result? Rather than ask for "any" result 
> and ignoring any unexpected extra items, I think it would be better to 
> have a helper function that verifies you have got exactly one result.

Yes, that could be useful. Maybe call it "one"?

-- 
Greg



More information about the Python-ideas mailing list