[Python-Dev] Re: method decorators (PEP 318) (original) (raw)
Shane Hathaway shane at zope.com
Mon Mar 29 10:27:47 EST 2004
- Previous message: [Python-Dev] Re: method decorators (PEP 318)
- Next message: [Python-Dev] Re: method decorators (PEP 318)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Greg Ewing wrote:
By the way, I happen to think there are better uses to which the word 'with' could be put, e.g. the suggestion of making
with lock(foo): dosomething() mean something like x = lock(foo) x.enter() try: dosomething() finally: _x.exit()
That would be nice, but here is what I would like it to mean:
def _f(): do_something() lock(foo)(_f)
That would allow the object of the "with" statement to execute the code block once, many times, or not at all.
Shane
- Previous message: [Python-Dev] Re: method decorators (PEP 318)
- Next message: [Python-Dev] Re: method decorators (PEP 318)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]