[PATCH] python2.3 with_*lock problems

Martin Pool mbp at sourcefrog.net
Mon May 30 05:38:45 BST 2005

On Sun, 2005-05-29 at 23:24 -0500, John Arbash Meinel wrote:
> It turns out that the @ decorator syntax only exists in python 2.4. And
> while I think it looks wonderful and is a wonderful way to go, it breaks
> compatibility with python2.3.

I was actually expecting one of the Ruby people to pipe up about this; I
think their closure-like things would handle this rather more

> Is it planned to not support 2.3, I'm sure it has gone back and forth a bit.

2.3 is supported, and will remain so until there is a really strong
reason not to.  (Decorator syntax is not one.)  There are still a fair
number of people using it.

At the moment the test suite needs 2.4 but I see that as a bug.

> Anyway, the patch attached changes all of the @with_readlock and
> @with_writelock back to their old format of:
> def myfunc():
>     blah

> myfunc = with_readlock(myfunc)

Given that, it's probably clearer just to rewrite it into try/finally
blocks.  Oh well, at least now I know more about decorators.


More information about the bazaar mailing list