views:

42

answers:

2

Zope Interfaces are a great way to get some Java-style "design by contract" into a python program. It provides some great features such as implement-able interfaces and a really neat pattern for writing adaptors for objects.

Unfortunately, since it's part of a very mature platform which runs just fine on Python 2.x the developers of Zope.Interface have not yet prioritised porting to Python 3. I'd probably do the same in their situation. :-)

What I want to know is:

Is there another way to achieve a similar effect on the 3.x platform? I want to use the same kinds of patterns that Zope.Interface makes easy but I don't want to roll my own interfaces system. Or I should just forget about interfaces for now and design around this problem.

+1  A: 

There appears to be a Python 3 branch of Zope Interfaces here and announced here.

Ned Deily
+1, I found this link also. It appears that the project has not yet released anything which is production stable. I do not think I can build on that, however it looks promising.
Salim Fadhley
Lennart is a regular contributor here on SO so perhaps he'll chime in with a status update.
Ned Deily
A: 

Use python 2.x. It is more supported by most libraries. It has many 3.x features plus all 3rd party libraries. Later when dependencies are available you can migrate to py3 using 2to3.

nosklo
Thanks, but that's not really an answer. For various reasons we are keen to support Python 3.x and not really that interested in anything older than python 2.6.
Salim Fadhley