Dennis Lee Bieber wrote:
> It might be more economical to perform the conversion while fetching
> the data:
>
> mdict = {}
> for rec in crsr:
> mdict[rec[0]] = rec[1:]
>
I didn't think of that. I just took the fetchall() from my first
version (where I looped through the tuples, which was very slow)
I just dropped the .fetchall() part, and as you said: it works fine,
with 1 copy less. (but it doesn't save me time)
dict((int(row[0]), row[1:]) for row in cursor)
thanks!
--
http://mail.python.org/mailman/listinfo/python-list