New submission from Erlend E. Aasland <erlend.aasl...@innova.no>:
Ref. Serhiy's msg387858 in bpo-43350: "Maybe the code could be rewritten in more explicit way and call pysqlite_statement_reset() only when it is necessary [...]" Currently, we try to reset statements in all "statement exit" routes. IMO, it would be cleaner to just reset statements when we really need to: 1. before the first sqlite3_step() 2. at cursor exit, if there's an active statement (3. in pysqlite_do_all_statements() ... see bpo-44092) This will make the code easier to follow, and it will minimise the number of resets. The current patch is pretty small: 7 insertions(+), 33 deletions(-) Pro: - less lines of code, less maintenance - cleaner exit paths - optimise SQLite API usage Con: - code churn If this is accepted, PR 25984 of bpo-44073 will be easier to land and review :) ---------- components: Extension Modules messages: 399931 nosy: berker.peksag, erlendaasland, pablogsal, serhiy.storchaka priority: normal severity: normal status: open title: [sqlite3] only reset statements when needed _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue44958> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com