[Python-Dev] Merging PEP 310 and PEP 340-redux?

Steven Bethard steven.bethard at gmail.com
Thu May 12 15:52:10 CEST 2005


On 5/12/05, Nick Coghlan <ncoghlan at gmail.com> wrote:
> Yeah, I figured out a tidier way to handle it after reading Phillip's message
> earlier today. My idea is similar to your second solution, but with an early
> exit via break, continue or return still indicated to the __exit__() method via
> TerminateBlock so that examples like transaction() continue to do the right thing:

Do they?  I don't write enough transactional code, but I would have
thought that break, continue or return would have been a normal,
expected exit from the do-statement and therefore should do a
db.commit(), not a db.rollback().  Do you think you could add an
example of how the transaction do-statement would be used in such a
way that these would be the desired semantics?

Thanks,

STeVe
-- 
You can wordify anything if you just verb it.
        --- Bucky Katt, Get Fuzzy


More information about the Python-Dev mailing list