From: Alex Martelli [mailto:aleaxit at yahoo.com] > Basically, by exposing suitable methods an iterator could "make its > abilities know" to functions that may or may not need to wrap it in > order to achieve certain semantics -- so the functions can build > only those wrappers which are truly indispensable for the purpose. > Roughly the usual "protocol" approach -- functions use an object's > ability IF that object exposes methods providing that ability, and > otherwise fake it on their own. I'm glad you pointed this out. This whole thing was starting to sound very like the sort of thing that the adaptation PEP was intended to cover. Can the people who need this get the capability via a suitable adaptation approach? I'm not familiar enough with the technique to be sure. If so, wouldn't that be a more general technique (as well as being already available in 3rd party modules like PyProtocols). Paul.
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