On Fri, Feb 17, 2006 at 05:29:32PM +0100, Armin Rigo wrote: > > Where obj must be either an int or a long or another object that has the > > __index__ special method (but not self). > The "anything but not self" rule is not consistent with any other > special method's behavior. IMHO we should just do the same as > __nonzero__(): > * __nonzero__(x) must return exactly a bool or an int. Yes, very much so. And in case people worry that this makes wrapping objects harder: proxy objects (for instance) would do 'return operator.index(self._real)'. -- Thomas Wouters <thomas at xs4all.net> Hi! I'm a .signature virus! copy me into your .signature file to help me spread!
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