[DB-SIG] Use of context managers with DB API 2

Federico Di Gregorio fog at dndg.it
Mon Nov 5 10:34:57 CET 2012


On 05/11/2012 10:28, M.-A. Lemburg wrote:
> On 04.11.2012 23:24, Christoph Zwerschke wrote:
>> > To wrap everything up, as a result of our discussion, I will do the following in the next version of
>> > PyGreSQL:
>> > 
>> > * make connections context managers for transactions
>> >   (may not be the optimal solution, but it's already established)
>> > * make cursors self-closing context managers (evident)
>> > * not implement shortcut functions (see above)
>> > 
>> > Is everybody happy with that?
> Sounds good :-)

Absolutely. :)

federico

-- 
Federico Di Gregorio                         federico.digregorio at dndg.it
Studio Associato Di Nunzio e Di Gregorio                  http://dndg.it
  We should forget about small efficiencies, say about 97% of the
   time: premature optimization is the root of all evil.    -- D.E.Knuth


More information about the DB-SIG mailing list