Re: [Numpy-discussion] Integers to integer powers, let's make a decision

June 4, 2016
4:35 p.m.
+1 (grudgingly) My thoughts on this are: (i) Intuitive APIs are better, and power(a,b) suggests to a lot of (most?) readers that you are going to invoke a function like the C pow(double x, double y) on every element. Doing positive integer powers with the same function name suggests a correspondence that is in practice not that helpful. With a time machine I’d suggest a separate function for positive integer powers, however... (ii) I think that ship has sailed, and particularly with e.g. a**3 the numpy conventions are backed up by quite a bit of code, probably too much to change without a lot of problems. So I’d go with integer ^ negative integer is an error. Peter
3205
Age (days ago)
3205
Last active (days ago)
0 comments
1 participants
participants (1)
-
Peter Creasey