Deeply nested dictionaries - should I look into a database or am I just doing it wrong?

Andrew Berg bahamutzero8825 at gmail.com
Sun Jul 31 14:36:43 EDT 2011


On 2011.07.31 02:41 AM, Thorsten Kampe wrote:
> The "QueueItem.x264['avs']['filter']['fft3d']['ffte'])" example does not 
> look right. Especially the mix of "." and "[]" references. Actually, 
> dictionaries in a dictionary don't look right to me either.
QueueItem is the class; x264 is a dictionary.

> The design of your data structure won't change. I would think that your 
> program already mimicks it by nested class statements so you're 
> duplicating the already existing class structure via dictionaries in 
> order to have it available in the main class.
Huh? I only have no nested class statements.

> Another approach would be named tuples instead of dictionaries or flat 
> SQL tables.
What would the advantage of that be?

-- 
CPython 3.2.1 | Windows NT 6.1.7601.17592 | Thunderbird 5.0
PGP/GPG Public Key ID: 0xF88E034060A78FCB



More information about the Python-list mailing list