akuchlin@mems-exchange.org writes: > Oh, well; I need to come up with a different example for subclassing a > built-in type, then. Thanks! <puts on thinking cap> Andrew, You can take a look at that implementation of xml.dom.minidom.NodeList; for Python 2.2, the implementation goes like this: ---------------------------------------------------------------------- class NodeList(list): def item(self, index): if 0 <= index < len(self): return self[index] length = property(lambda self: len(self), doc="The number of nodes in the NodeList.") ---------------------------------------------------------------------- -Fred -- Fred L. Drake, Jr. <fdrake at acm.org> PythonLabs at Zope Corporation
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