Andrew Koenig <ark@research.att.com> writes: > So what I wonder is this: Has there been much thought about making > these type categories more explicitly part of the type system? Certainly. Such a feature has been called "interface" or "protocol"; I usually associate with "interface" a static property (a type implements an interface, by means of a declaration) and with "protocol" a dynamic property (an object conforms to a protocol, by acting according to the rules that the protocol set). Your question exist in many variations. One of it lead to the creation of the types-sig, another one triggered papers titled "Optional Static Typing", see http://www.python.org/~guido/static-typing/ The most recent version of an attempt to making interfaces part of Python is PEP 245, http://python.org/peps/pep-0245.html I believe there is agreement by now that there will be difference between declared interfaces and implemented protocols: an object may follow the protocol even if it did not declare the interface, and an object may violate a protocol even if its type did declare the interface. Beyond that, there is little agreement. Regards, Martin
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