Danny Yoo said unto the world upon 06/04/06 04:38 PM:
> Yes, I agree that the readability of the code is primary. Understandng
> the recursive approach depends on the reader's comfort with recursive
> functions, and the non-recursive code depends on the reader's comfort with
> arithmetic operat
> One way to get rid of the 'recursed' flag is to refactor slightly, and
> break out the sorting in another helper function, like this:
>
> ##
> def tva_dict_maker(atoms):
> tvas = tiva_helper(atoms)
^^^
>
> Your post got me to take another bash and I obtained a recursive
> solution. But, subject to the caveat that my recursive solution might
> well be non-optimal, the non-recursive approach seems a bit better to
> me. Opinions welcome :-)
>
> My recursive solution:
>
> def recursive_tva_dict_maker(a
Orri Ganel said unto the world upon 01/04/06 03:04 PM:
> Brian van den Broek wrote:
>> Then, the output is like so:
>>
>> >>> atoms = ["a","b","c"]
>> >>> tvas = tva_dict_maker(atoms)
>> >>> display_tvas(tvas)
>> a:Trueb:Truec:True
>> a:Trueb:Truec:False
>> a:Trueb:Fals
Danny Yoo said unto the world upon 31/03/06 08:27 PM:
>
>>Then, the output is like so:
>>
>> >>> atoms = ["a","b","c"]
>> >>> tvas = tva_dict_maker(atoms)
>> >>> display_tvas(tvas)
>>a:Trueb:True c:True
>>a:Trueb:True c:False
>>a:Trueb:False c:True
>>a:Trueb:False
Brian van den Broek wrote:
>Hi all,
>
>I've been too busy with life to do much Python of late. So, I am a bit
>rusty. :-(
>
>I've got some code that does what it needs to but I think I might be
>overlooking a much smoother way to get what I need.
>
>The code takes a list of strings and returns a
> Then, the output is like so:
>
> >>> atoms = ["a","b","c"]
> >>> tvas = tva_dict_maker(atoms)
> >>> display_tvas(tvas)
> a:Trueb:True c:True
> a:Trueb:True c:False
> a:Trueb:False c:True
> a:Trueb:False c:False
> a:False b:True c:True
> a:False
Hi all,
I've been too busy with life to do much Python of late. So, I am a bit
rusty. :-(
I've got some code that does what it needs to but I think I might be
overlooking a much smoother way to get what I need.
The code takes a list of strings and returns a list of dictionaries,
where each dic