Hello,
On Thu, Nov 04, 2010 at 09:20:04PM +, Arnaud
Delobelle wrote:
> Tough requirement, but I think I've got it. Two
> lambdas, one reduce, one map ;)
>
> >>> a = {'a' : {'b' :{'/' :[1,2,3,4], 'ba' :{'/' :[41,42,44]}, 'bc'
> >>> :{'/':[51,52,54], 'bcd' :{'/':[68,69,66]}}},'c' :{'/' :[5,6,
On Nov 4, 10:21 am, de...@web.de (Diez B. Roggisch) wrote:
> macm writes:
> for value in d.values():
> if isinstance(value, dict):
I'm not a Python guru, but... do you care that you're breaking duck
typing here? I've had other programmers warn me against using
isinstance() for this
macm writes:
> Hi Folks
>
> How find all childrens values of a nested dictionary, fast!
>
>>>> a = {'a' : {'b' :{'/' :[1,2,3,4], 'ba' :{'/' :[41,42,44]} ,'bc'
>>>> :{'/':[51,52,54],
macm wrote:
> About Peter script
>
> I am receiving
>
for v in f(a['a']['b']):
> ... b.extend(v)
> ...
> Traceback (most recent call last):
> File "", line 2, in
> TypeError: 'int' object is not iterable
>
> I am trying understand this error.
You are probably mixing Diez' implement
aceback (most recent call last):
> File "", line 2, in
> TypeError: 'int' object is not iterable
>
> I am trying understand this error.
>
> Best Regards and thanks a lot again!
>
> Mario
> macm
>
> On 4 nov, 15:26, Peter Otten <__pete...@we
all last):
File "", line 2, in
TypeError: 'int' object is not iterable
I am trying understand this error.
Best Regards and thanks a lot again!
Mario
macm
On 4 nov, 15:26, Peter Otten <__pete...@web.de> wrote:
> macm wrote:
> > How find all childrens
macm wrote:
> How find all childrens values of a nested dictionary, fast!
>
>>>> a = {'a' : {'b' :{'/' :[1,2,3,4], 'ba' :{'/' :[41,42,44]} ,'bc'
>>>> :{'/':[51,52,54], 'bcd' :{
macm writes:
> Hi Folks
>
> How find all childrens values of a nested dictionary, fast!
There is no faster than O(n) here.
>
>>>> a = {'a' : {'b' :{'/' :[1,2,3,4], 'ba' :{'/' :[41,42,44]} ,'bc
Hi Folks
How find all childrens values of a nested dictionary, fast!
>>> a = {'a' : {'b' :{'/' :[1,2,3,4], 'ba' :{'/' :[41,42,44]} ,'bc'
>>> :{'/':[51,52,54], 'bcd' :{'/':[68,69,66]}}},