[Checkins] SVN: zope.interface/trunk/ Merge of regebro-python3 branch, adding Python 3.1 compatibility\!

Lennart Regebro regebro at gmail.com
Mon Apr 12 16:57:00 EDT 2010


On Fri, Apr 9, 2010 at 10:20, Wichert Akkerman <wichert at wiggy.net> wrote:
> On 4/9/10 10:16 , Lennart Regebro wrote:
>>
>> +  The 3.1 support is completely backwards compatible. However, the
>> implements
>> +  syntax used under Python 2.X does not work under 3.X, since it depends
>> on
>> +  how metaclasses are implemented and this has changed. Instead it now
>> supports
>> +  a decorator syntax (also under Python 2.X):
>> +
>> +    class Foo:
>> +        implements(IFoo)
>> +        ...
>> +
>> +  can now also be written
>> +
>> +    @implementor(IFoo):
>> +    class Foo:
>> +        ...
>
> Can we use that in python 2.6 as well? It's a much nicer syntax.

We can indeed.

-- 
Lennart Regebro: Python, Zope, Plone, Grok
http://regebro.wordpress.com/
+33 661 58 14 64


More information about the checkins mailing list