Hi,

Checked in 72ce40f4803c.

Greg, about the second example you reported:

class C(object):
     def __rmul__(self, other):
         other *= 2
         return other
     def __index__(self):
         return 3
print [1] * C()   # -> CPython: [1,1]  PyPy: [1,1,1]

This is obscure.  It works that way because in that particular case,
CPython first tries __mul__/__rmul__ and then tries the internal
sq_repeat slot of the list (which calls C.__index__()).  I think there
is just no way to reproduce this behavior while remaining sane :-/


Armin
_______________________________________________
pypy-dev@codespeak.net
http://codespeak.net/mailman/listinfo/pypy-dev

Reply via email to