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

Chris Rebert clp2 at rebertia.com
Sun Jul 31 15:51:20 EDT 2011


On Sun, Jul 31, 2011 at 11:36 AM, Andrew Berg <bahamutzero8825 at gmail.com> wrote:
> On 2011.07.31 02:41 AM, Thorsten Kampe wrote:
<snip>
>> Another approach would be named tuples instead of dictionaries or flat
>> SQL tables.
> What would the advantage of that be?

Less punctuation noise:
QueueItem.x264.avs.filter.fft3d.ffte
vs.
QueueItem.x264['avs']['filter']['fft3d']['ffte']

It would also make clear that your sets of "keys" are static (unlike
typical dictionary usage).

Cheers,
Chris
--
http://rebertia.com



More information about the Python-list mailing list