How find all childrens values of a nested dictionary, fast!

Peter Otten __peter__ at web.de
Thu Nov 4 14:09:13 EDT 2010


macm wrote:

> About Peter script
> 
> I am receiving
> 
>>>> for v in f(a['a']['b']):
> ...     b.extend(v)
> ...
> Traceback (most recent call last):
>   File "<stdin>", line 2, in <module>
> TypeError: 'int' object is not iterable
> 
> I am trying understand this error.

You are probably mixing Diez' implementation of f() with my invocation code. 
Or you have modified the input data and now it contains int values.

Peter




More information about the Python-list mailing list