diff options
author | saurabh <e.samehta@gmail.com> | 2016-11-01 02:28:33 +0100 |
---|---|---|
committer | saurabh <e.samehta@gmail.com> | 2016-11-01 02:58:36 +0100 |
commit | f685f1a83de2d8fc1e0f48167a204248b6656a63 (patch) | |
tree | 1d24d307936f03e558a4a661d7dd1560a07437cf /doc | |
parent | 6ae842001332f532e0c76815d49336ecc2b88dde (diff) | |
download | numpy-f685f1a83de2d8fc1e0f48167a204248b6656a63.tar.gz |
ENH: Deprecation warnings for `/` integer division when running python -3
When python is invoked with switch -3, it emits waring "classic int division"
for strict integer divisions. The same behavior is now implemented to numpy
with this fix
Diffstat (limited to 'doc')
-rw-r--r-- | doc/release/1.12.0-notes.rst | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/doc/release/1.12.0-notes.rst b/doc/release/1.12.0-notes.rst index 0baa33049..4029abc48 100644 --- a/doc/release/1.12.0-notes.rst +++ b/doc/release/1.12.0-notes.rst @@ -351,6 +351,20 @@ distance metric that combines two vectors to produce a scalar could be vectorized with ``signature='(n),(n)->()'``. See ``np.vectorize`` for full details. +Emit py3kwarnings for division of integer arrays +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +To help people migrate their code bases from Python 2 to Python 3, the +python interpreter has a handy option -3, which issues warnings at runtime. +One of its warnings is for integer division: + $ python -3 -c "2/3" + + -c:1: DeprecationWarning: classic int division +In Python 3, the new integer division semantics also apply to numpy arrays. +With this version, numpy will emit a similar warning: + $ python -3 -c "import numpy as np; np.array(2)/np.array(3)" + + -c:1: DeprecationWarning: numpy: classic int division + Changes ======= |