language design question

OKB (not okblacke) brenNOSPAMbarn at NObrenSPAMbarn.net
Sun Jul 9 18:45:53 EDT 2006


Terry Reedy wrote:

> Consider
>>>> map(len, ('abc', (1,2,3), [1,2], {1:2}))
> [3, 3, 2, 1]
> 
> Now try to rewrite this using methods (member functions).

[a.len() for a in ('abc', (1,2,3), [1,2], {1:2})]

-- 
--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