On Sun, Mar 6, 2011 at 11:06 PM, Javier <nos...@nospam.com> wrote:
> Looks a good idea.  I use this kind of "recursive dicts" to represent
> tree like datastruct in python.  Like:
>
> car["ford"]["taurus"]["price"]=...
> car["toyota"]["corolla"]["mpg"]=...
> car["toyota"]["corolla"]["price"]=...
>
<snip>
> Does anybody have  another idea for representing tree-like data?  Is
> there another type for trees in python?

You see a tree, I see a database (http://docs.python.org/library/sqlite3.html ):

+--------------+---------+-----+-------+
| Manufacturer | Model   | MPG | Price |
+--------------+---------+-----+-------+
| Ford         | Taurus  | ... | $...  |
| Toyota       | Corolla | ... | $...  |
+--------------+---------+-----+-------+

Cheers,
Chris
--
http://blog.rebertia.com
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to