diff options
author | Sebastian Berg <sebastian@sipsolutions.net> | 2020-06-16 14:08:51 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-16 14:08:51 -0500 |
commit | da1621637b7c59c155ec29466fb5f810ebd902ac (patch) | |
tree | f4ca8771d428bd67e0fb5c9dc331b4fd92fc232b /doc/release | |
parent | 0991b083bb0ee8bbd767deadbe237994397e79c5 (diff) | |
parent | 70f4526b16b1f5815c7a2d46a2b10f1961166463 (diff) | |
download | numpy-da1621637b7c59c155ec29466fb5f810ebd902ac.tar.gz |
Merge pull request #14882 from eric-wieser/6103-alias-__getattr__-deprecation
DEP: Deprecate aliases of builtin types in python 3.7+
Diffstat (limited to 'doc/release')
-rw-r--r-- | doc/release/upcoming_changes/14882.deprecation.rst | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/doc/release/upcoming_changes/14882.deprecation.rst b/doc/release/upcoming_changes/14882.deprecation.rst new file mode 100644 index 000000000..db3b39d4c --- /dev/null +++ b/doc/release/upcoming_changes/14882.deprecation.rst @@ -0,0 +1,30 @@ +Using the aliases of builtin types like ``np.int`` is deprecated +---------------------------------------------------------------- + +For a long time, ``np.int`` has been an alias of the builtin ``int``. This is +repeatedly a cause of confusion for newcomers, and is also simply not useful. + +These aliases have been deprecated. The table below shows the full list of +deprecated aliases, along with their exact meaning. Replacing uses of items in +the first column with the contents of the second column will work identically +and silence the deprecation warning. + +In many cases, it may have been intended to use the types from the third column. +Be aware that use of these types may result in subtle but desirable behavior +changes. + +================== ================================= ================================================================== +Deprecated name Identical to Possibly intended numpy type +================== ================================= ================================================================== +``numpy.bool`` ``bool`` `numpy.bool_` +``numpy.int`` ``int`` `numpy.int_` (default int dtype), `numpy.cint` (C ``int``) +``numpy.float`` ``float`` `numpy.float_`, `numpy.double` (equivalent) +``numpy.complex`` ``complex`` `numpy.complex_`, `numpy.cdouble` (equivalent) +``numpy.object`` ``object`` `numpy.object_` +``numpy.str`` ``str`` `numpy.str_` +``numpy.long`` ``int`` (``long`` on Python 2) `numpy.int_` (C ``long``), `numpy.longlong` (largest integer type) +``numpy.unicode`` ``str`` (``unicode`` on Python 2) `numpy.unicode_` +================== ================================= ================================================================== + +Note that for technical reasons these deprecation warnings will only be emitted +on Python 3.7 and above. |