4 ms·
It's the first time I hear about Zope, and also zope.interface. How widely is this used? I personally would be hesitant to adopt something depending on some no
by albertzeyer 6y ago
It's the first time I hear about Zope, and also zope.interface. How widely is this used?
I personally would be hesitant to adopt something depending on some not-well-known library.
Then on the other side, if sth like interfaces are missing in core Python, and typing.Protocol is not quite the same thing, maybe we should try to extend the core typing for sth like typing.Interface?
Or maybe first to typing_extensions.
Or, as I understood it, maybe we just need to fix ABCMeta (for MyPy), and then already have what we want?
I'm also not quite sure I understood: Why do I need this base class zope.interface.Interface at all? Why not just implement IPlugin or whatever like it is mentioned there, but not deriving from Interface, and throw NotImplementedError in methods (tools like PyCharm then recognize this is an abstract method). And all concrete types/classes just explicitly need to derive from this IPlugin class. That's mostly what I anyway do already, and what I also see in other projects code. This approach seems to be fine. What's the problem with it?
- musingsole 6y agoPython interfaces are an obscure feature. Zope.interface is the the ancestor of Python interfaces. Which is to say, not widely.
- robohoe 6y agoAFAIK I’ve only seen Zenoss (monitoring software) use Zope widely. About the only place where I saw it.
- CraigJPerry 6y agoIt used to be very very popular, back around python 2.4 days was its peak i think. That was around 15 years ago roughly from memory.
- smoe 6y agoI was a bit surprised to see zope.interfaces pop up these days. If you are not using the entire Zope Component Architecture I'm not sure how useful it has been since Python 3. Zope and things build on top of it (Plone CMS e.g.) was fairly popular in the early-mid 2000s and was in my opinion ahead of it's time in many ways. But also overkill for most projects.
- qyi 6y agoZope was pretty popular a decade ago, never got into it though.
- stevesimmons 6y agoAnyone curious about the history of Zope should read [1] for how the Python web server landscape looked in 2001. [1] https://www.ukuug.org/events/linux2001/papers/html/SRichter/ZopePaper.html https://www.ukuug.org/events/linux2001/papers/html/SRichter/... I discovered Zope in late 2000 while looking for an open source web application platform. Somehow I heard about Zope and thus learnt Python version 1.5. Zope seemed to be on the cusp of greatness. The Zope conference in Paris in early 2001 was my first tech user group meeting. (Was anyone else reading this there?) I stopped with Zope in 2003. Then 7 years later got a strange sense of deja vu at a bank I joined, where its trading platform used a Python object database possibly inspired by Zope's ZODB.
- BerislavLopac 6y agoIMO, protocols are way better than interfaces. They're essentially the same, except you don't need to inherit from a protocol for your object to be compliant.