> _fields = {'encode':0,'decode':1,'reader':2,'writer':3} > class CodecInfo(tuple): > __dynamic__ = 0 > def __getattr__(self, name): > try: > return self[_fields[name]] > except KeyError: > raise AttributeError, name You want to change that raise statement into return tuple.__getattr__(self, name) Remember, new-style __getattr__ *replaces* the built-in getattr operation; it doesn't only get invoked when the built-in getattr doesn't find the attribute, like it does for classic classes. (I'm still considering whether this is too backwards incompatible; we could have two getattr hooks, one old-style and one new-style.) --Guido van Rossum (home page: http://www.python.org/~guido/)
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