On Oct 12, 1:20 pm, Jon Clements <jon...@googlemail.com> wrote: > On 12 Oct, 16:10, Roy Smith <r...@panix.com> wrote: > > > PEP 249 says about executemany(): > > > Prepare a database operation (query or command) and then > > execute it against all parameter sequences or mappings > > found in the sequence seq_of_parameters. > > > are there any plans to update the api to allow an iterable instead of > > a sequence? > > I'm not understanding (probably me). Example?
I have a dictionary, d, which has a million items in it, and want to do something like: executemany("update foo set bar = %s where id = %s", d.iteritems()) If executemany accepted an iterable, that would work. But, it only accepts a sequence, so I need to do: executemany("update foo set bar = %s where id = %s", d.items()) which generates a million-item temporary list. Or am I mis- understanding the PEP? -- http://mail.python.org/mailman/listinfo/python-list