[pypy-issue] [issue1160] numpypy.int missing and numpy.integer doesn't work

Valery tracker at bugs.pypy.org
Wed Oct 3 08:55:06 CEST 2012


Valery <khamenya at gmail.com> added the comment:

Update: np.integer is *not* an alias of np.int. Proof in CPython 2.7.1 / numpy 1.6.1:

  >>> set(dir(np.int))==set(dir(np.integer))
  False

In fact np.integer is an abstract class 
(http://docs.scipy.org/doc/numpy/reference/arrays.scalars.html)

Sadly, http://docs.scipy.org/doc/numpy/user/basics.types.html also states ambiguously:

  "int	-- Platform integer (normally either int32 or int64)"

However at least as for numpy 1.6.1 it is neither numpy.int32 nor numpy.int64. They rather 
just meant the number of bits in __builtin__.int in this fancy ambiguous way.

Facts:

  >>> np.int == __builtin__.int
  True

  >>> np.int
  <type 'int'>


  >>> np.bool == __builtin__.bool
  True

  >>> np.bool
  <type 'bool'>

----------
nosy: +agaynor

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue1160>
________________________________________


More information about the pypy-issue mailing list