1

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.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Salim Fadhley
  • 22,020
  • 23
  • 75
  • 102
  • 1
    You've discovered one of the main reasons not to use Python 3 yet: because the libraries you depend on don't support it. – Ned Batchelder Nov 10 '09 at 01:49
  • Yes, it's annoying however we are very keen to deliver something useful for the new platform. The nature of our product is that it has very few dependancies - we'd like to be part of pushing Python 3.x adoption. – Salim Fadhley Nov 10 '09 at 14:23

2 Answers2

2

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

Ned Deily
  • 83,389
  • 16
  • 128
  • 151
  • +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 Nov 09 '09 at 23:51
  • Lennart is a regular contributor here on SO so perhaps he'll chime in with a status update. – Ned Deily Nov 09 '09 at 23:54
  • The branch was merged and zope.interface has been Python 3 compatible since version 3.6. – Martijn Pieters May 31 '12 at 13:05
0

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
  • 217,122
  • 57
  • 293
  • 297
  • 1
    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 Nov 10 '09 at 14:21