PEP 249 (database api) -- executemany() with iterable?

J. Gerlach gerlach_joerg at web.de
Wed Oct 13 09:11:48 EDT 2010


Am 13.10.2010 14:26, schrieb Jon Clements:
> On 12 Oct, 20:21, "J. Gerlach" <gerlach_jo... at web.de> wrote:
>> Am 12.10.2010 17:10, schrieb Roy Smith:
>>
>>> [A]re there any plans to update the api to allow an iterable instead of
>>> a sequence?
>>
>> [sqlite3 example snipped]
> 
> What happens if you do itertools.repeat(0) instead of xrange(100) ?

And there I see why I don't want ``executemany()`` to take a generator
-- the never-ending ones will do some damage.

But on a similar note: would a ``execute_n_repeats(statement, iterable,
maximum_rows)`` be better?


Jörg

--
Have a nice day!



More information about the Python-list mailing list