try pattern for database connection with the close method

Mario Figueiredo marfig at gmail.com
Sun Feb 22 18:30:13 EST 2015


On Sun, 22 Feb 2015 13:15:09 -0600, Skip Montanaro
<skip.montanaro at gmail.com> wrote:

>
>Sorry, I haven't paid careful attention to this thread, so perhaps
>this has already been suggested, however... Can't you write your own
>class which delegates to the necessary sqlite3 bits and has a context
>manager with the desired behavior? Thinking out loud, you could define
>a ConnectionMgr class which accepts a sqlite3 connection as a
>parameter

Indeed I could. Thank you. 



More information about the Python-list mailing list