Thoughts about Python

OKB (not okblacke) BrenBarn at aol.com
Tue Feb 24 13:19:29 EST 2004


Terry Reedy wrote:

> Quiz: how would you rewrite map(len, ['abc', (1,2,3,4), [5,6]]) if
> len() were a method?

    	[ a.len() for a in ['abc', (1,2,3,4), [5,6]] ]

-- 
--OKB (not okblacke)
Brendan Barnwell
"Do not follow where the path may lead.  Go, instead, where there is
no path, and leave a trail."
	--author unknown



More information about the Python-list mailing list