On Thu, 05 May 2005 14:58:02 +0200 "Martin v. Löwis" <martin at v.loewis.de> 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/
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4