Select as dictionary...

Carsten Haese carsten at uniqsys.com
Mon Oct 1 10:33:54 EDT 2007


> linkdict = dict(iter(aia.fetchone,None))

And by the way, that line can be shortened to "linkdict=dict(aia)" if
the cursor object supports the iterator protocol, but that's not a
mandatory feature in DB-API v2. The longer form is guaranteed to work
with any DB-API v2 compliant implementation.

-- 
Carsten Haese
http://informixdb.sourceforge.net





More information about the Python-list mailing list