Dennis Lee Bieber wrote: > c.execute("insert into %s (%s) values (%s)" > % ("statecode", > ", ".join(data.keys() ), > ", ".join(["%s"] * len(data.keys() ) ) ), > data.values() ) > # NOTE: only works if data.keys() and data.values() are > # in the same order. >
It is guaranteed, provided you don't mutate the dictionary between times. In any case, it's a bit hard to imagine under what circumstances there would be different traversal orders to obtain keys and values :-) -- http://mail.python.org/mailman/listinfo/python-list