
Oct. 21, 2019
5:49 p.m.
Agreed -- Anyone who uses numpy a lot might make the same assumption, because numpy vectorizes. Anybody who doesn't might expect an extension-equivalent:
import numpy as np a1 = np.arange(2,6) a2 = np.arange(4,0,-1) a2 array([4, 3, 2, 1]) a1 array([2, 3, 4, 5]) a1 + a2 array([6, 6, 6, 6]) l1 = list(range(2,6)) l2 = list(range(4,0,-1) ... ) l1 + l2 [2, 3, 4, 5, 4, 3, 2, 1]