[issue11477] Incorrect operand precedence when implementing sequences in C

Nick Coghlan report at bugs.python.org
Sat May 16 11:04:15 CEST 2015


Nick Coghlan added the comment:

Nathaniel Smith pointed out on python-dev (https://mail.python.org/pipermail/python-dev/2015-May/140006.html) that NumPy is relying on this bug to implement elementwise multiplication of a list by a scalar array:

    In [9]: [1, 2] * np.array(2)
    Out[9]: array([2, 4])

He also pointed out that PyPy implemented bug-for-bug compatibility with this some time back: https://bitbucket.org/pypy/pypy/src/a1a494787f4112e42f50c6583e0fea18db3fb4fa/pypy/objspace/descroperation.py?at=default#cl-692

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11477>
_______________________________________


More information about the Python-bugs-list mailing list