diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2019-03-11 23:49:54 -0700 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2019-03-16 10:04:58 -0700 |
commit | 0764929543c85decde9d664367dbf7d8f137fe1f (patch) | |
tree | 54901a64ac4fec1a52ab48808767309fc7ce4cab /doc/release | |
parent | 5646b46341240ddecc1692d21610e49125b4b16e (diff) | |
download | numpy-0764929543c85decde9d664367dbf7d8f137fe1f.tar.gz |
DEP: polynomial: Be stricter about integral arguments
This changes the behavior for:
* The `deg` and `axis` arguments of `<type>der`
* The `deg` and `axis` arguments of `<type>int`
* The `deg` argument of `<type>gauss`
* The `deg` argument of `<type>vander2d`
* The `deg` argument of `<type>vander3d`
The old behavior was:
* Raise `ValueError` if the argument is a float, but not an integral one
* Allow a float like `1.0` to mean `1`.
This is inconsistent with most other integer-accepting APIs in numpy, which require these to be actual integers, and raise TypeError when they are not.
The new behavior is:
* Raise `TypeError` if the argument is a float, but not an integral one
* Emit a `DeprecationWarning` if a float like `1.0` is passed, continuing to allow it its old meaning.
Diffstat (limited to 'doc/release')
-rw-r--r-- | doc/release/1.17.0-notes.rst | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/doc/release/1.17.0-notes.rst b/doc/release/1.17.0-notes.rst index d8ece4244..6440cdd60 100644 --- a/doc/release/1.17.0-notes.rst +++ b/doc/release/1.17.0-notes.rst @@ -18,6 +18,15 @@ New functions Deprecations ============ +``np.polynomial`` functions warn when passed ``float``s in place of ``int``s +---------------------------------------------------------------------------- +Previously functions in this module would accept ``float``s provided their +values were integral. For consistency with the rest of numpy, doing so is now +deprecated, and in future will raise a ``TypeError``. + +Similarly, passing a float like ``0.5`` in place of an integer will now raise a +``TypeError`` instead of the previous ``ValueError``. + Future Changes ============== |