On 3/12/2011 8:33 AM, Laura Creighton wrote: > The thread with the whole gory details begins here: > http://codespeak.net/pipermail/pypy-dev/2011q1/006958.html The second, multiplication issue does appears to be the same issue. Augmenting my previous test: class C(object): def __iter__(self): yield 'yes!' def __radd__(self, other): other.append('bug!') return other def __rmul__(self, other): other *= 2 return other def __index__(self): return 3 class L(list): def __iadd__(self, other): list.__iadd__(self,other) return self def __mul__(self, other): return L(list.__imul__(self,other)) z1, z2, c = [], L(), C() z1 += c z2 += c print(z1, z2, [1]*c, L([1])*c) >>> ['bug!'] ['yes!'] [1, 1] [1, 1, 1] # PyPy prints ['yes!'], [1, 1, 1] I opened http://bugs.python.org/issue11477 -- Terry Jan Reedy
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