itertools.ilen?

Christos TZOTZIOY Georgiou tzot at sil-tec.gr
Tue Aug 19 12:29:00 EDT 2003


On Fri, 8 Aug 2003 10:02:39 +0000 (UTC), rumours say that Duncan Booth
<duncan at NOSPAMrcp.co.uk> might have written:

>I'm just curious, why did you decide to map the types to strings instead of 
>just using the types themselves?
>e.g.
>
>>>> import gc
>>>> sums = {}
>>>> for obj in gc.get_objects():
>    if type(obj) not in sums:
>        sums[type(obj)] = 1
>    else:
>        sums[type(obj)] += 1

Just because the initial code treated functions and methods as same;
also to be output-friendly.  I offered code with similar functionality,
only more concise, it wasn't code for my use :)
-- 
TZOTZIOY, I speak England very best,
Microsoft Security Alert: the Matrix began as open source.




More information about the Python-list mailing list