summaryrefslogtreecommitdiff
path: root/numpy/core/fromnumeric.py
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2016-03-20 14:32:21 +0100
committerSebastian Berg <sebastian@sipsolutions.net>2016-03-20 14:41:43 +0100
commit582600415d966dbfb7abafd3151415f59c6c422d (patch)
tree25dc92f351133e14be790555b168c09126b5da33 /numpy/core/fromnumeric.py
parent41ec9fc8b7ee9b710c3054b9e9409a7a1f6082f7 (diff)
downloadnumpy-582600415d966dbfb7abafd3151415f59c6c422d.tar.gz
BUG: Do not try sequence repeat unless necessary
Only if the other class actually implements sequence repeat, should it be tried. Otherwise classes which implement neither will cause the sequence repeat branch. This branch may fail for two reasons: 1. The scalar was not integer 2. The other object raises an error during repeat. Previously, the first did not happen for floats, etc. and the second was using a try/except logic. Now both will always error. An object which claims to support sequence repeat should never have to fall back to normal multiplication. Note that all of this is controversial in the final behaviour. We may actually want `[1, 2, 3] * np.float64(3.)` to return an array with `[3., 6., 9.]` at some point. - It was suggested to create a better error message, this is not covered here. The major point is fixed though, so: closing gh-7428
Diffstat (limited to 'numpy/core/fromnumeric.py')
0 files changed, 0 insertions, 0 deletions