[issue29160] pow with three int arguments works like it had two arguments

2017-01-20 Thread Mark Dickinson
Changes by Mark Dickinson : -- resolution: not a bug -> third party ___ Python tracker ___

[issue29160] pow with three int arguments works like it had two arguments

2017-01-05 Thread Mark Dickinson
Mark Dickinson added the comment: > shall we make a report for 'numpy guys' directly? Yes, please! I'll close here, since this isn't a core Python issue: what 3rd party libraries choose to do in their `__pow__` methods is out of the control of the core language. -- nosy:

[issue29160] pow with three int arguments works like it had two arguments

2017-01-04 Thread Pavel Chuvakhov
Pavel Chuvakhov added the comment: Sorry about script, n1 should be n, and n2 should be m. Updated script is attached. Ofc mpz is a way out. One also could cast int( np.int32 ) explicitly. I just wanted to underline that the best way is to hide all this stuff from a user and not make the

[issue29160] pow with three int arguments works like it had two arguments

2017-01-04 Thread Case Van Horsen
Case Van Horsen added the comment: This is a bug/limitation in numpy. If x and y are Python integers, and type(z) is of another numeric type, pow calls the nb_power slot of the underlying type. Here a quick example using numpy.int32 and gmpy2.mpz: >>> import numpy, gmpy2 >>> pow(11,13,7) 4

[issue29160] pow with three int arguments works like it had two arguments

2017-01-04 Thread Jim Fasarakis-Hilliard
Changes by Jim Fasarakis-Hilliard : -- components: +Interpreter Core -Distutils title: `pow` with three int arguments works like it had two arguments -> pow with three int arguments works like it had two arguments ___ Python

[issue29160] `pow` with three int arguments works like it had two arguments

2017-01-04 Thread Benjamin Pollak
Benjamin Pollak added the comment: I tried running your script, but it crashes on the last two lines (variables n2 and n1 appear to be undefined). Could you please update that script so we can have a better idea of the behavior of your bug? Thanks, BP -- nosy: +Benjamin Pollak

[issue29160] `pow` with three int arguments works like it had two arguments

2017-01-04 Thread Pavel Chuvakhov
New submission from Pavel Chuvakhov: Standard `pow` function of three integer arguments should result in a reminder `(x**y) % z`. It seems that `pow(x,y,z)` ignores `%z` operation if type(z) is not `int`. This happens also in the cases when `z` has type numpy.int32, numpy.int64, etc. I