Too Many Values To Unpack

Victor Subervi victorsubervi at gmail.com
Fri Nov 20 12:13:32 EST 2009


On Fri, Nov 20, 2009 at 12:14 PM, Shashank Singh <
shashank.sunny.singh at gmail.com> wrote:

> Are you sure your key values are 2-tuples in levelDict?
>

No. Here's some tweaked code:

    cursor.execute('select category from categories order by category')
    theTree = expand(cursor.fetchall())
    print theTree

Now, categories only has one category called 'cat1'. Here's what it prints:

{'cat1': {}}

Now what I don't understand about the above code, provided by Dennis Lee
Bieber, is the "expand" statement. Nor could I find any documentation
googling either "expand python" or "expand fetchall python". Could someone
please explain what this code does?
TIA,
V
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20091120/0fbb5c02/attachment-0001.html>


More information about the Python-list mailing list