On Thu, 05 May 2005 14:58:02 +0200 "Martin v. Löwis" <[EMAIL PROTECTED]> wrote:
> I haven't followed the PEP 340 discussion in detail, > but as the PEP doesn't list keywords that have been > considered and rejected, I'd like to propose my own: > use "after" instead of "block": > > after opening("/etc/passwd") as f: > for line in f: > print line.rstrip() > > after locking(myLock): > # code that needs to hold the lock > And *after* fits very nice for the examples above. However, it might get weird for: after transaction(db): # code inbetween new_trasn/ commit_or_abort The code pattern that will 'wrap' the block might not always make sense with the chosen keyword, if that keyword is not semantically neutral. (not time-related, not function-related, etc). Notice that is _no keyword_ is chosen, nothing prevents us from using (even if by aliasing): after_opening("/etc/passwd") as f: for line in f: print line.rstrip() after_locking(myLock): # code that needs to hold the lock My two cents. Senra -- Rodrigo Senra -- MSc Computer Engineer rodsenra(at)gpr.com.br GPr Sistemas Ltda http://www.gpr.com.br/ Personal Blog http://rodsenra.blogspot.com/ _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com