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 <[EMAIL PROTECTED]>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to