>>>>> "A" == Aahz <aahz@pythoncraft.com> writes: A> On the whole, I'd say that Python is actually *less* prone to A> this problem (because using an object doesn't generally require A> inheritance, just protocol); in fact, it suffers from the A> obverse problem. Consider this: | class C: | def open(self, name, flags=None): | def read(self): | def write(self, value): | def close(self): A> Can instances of C be used where a file object is expected? Maybe <wink>. That's why you tend to see things described like: "argument f must have a write() method that accepts a string." WIBNI we could define a protocol/interface/thingie that encapsulated that requirement? I'd even be happy to start out with no officially blessed interfaces, to give time to see what cream rises to the top. Zope's Interface and component model stuff is a good way to get some real experience with using these concepts in Python. -Barry
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4