[pypy-commit] [COMMENT] Pull request #15 for pypy/pypy: Added tolist() function to numpypy's scalars and multidim arrays
Bitbucket
notifications-noreply at bitbucket.org
Thu Dec 8 21:04:22 CET 2011
New comment on pull request:
https://bitbucket.org/pypy/pypy/pull-request/15/added-tolist-function-to-numpypys-scalars#comment-1329
Alex Gaynor (alex_gaynor) said:
Couple comments:
# You can't use self.value in W_GenericBox, as it doesn't have a specific type, the right way to go is probably to check self.get_dtype(space).kind and call eitehr __int__ or __float__ on it.
# tolist in numarray is a bit messy, a) it should always return a wrapped result, b) it probably doesn't need a special case for 1-dim arrays, it can just keep recursively calling tolist() since eventually it'll get down to a box.
# the tests for scalar can just directly instantiate a box object (e.g. numpy.int32()), they don't need to read it out of an array
# there should be a test for a 0-d array (whic are different than scalars)
Thanks for working on this!
--
This is a pull request comment notification from bitbucket.org.
You are receiving this either because you are participating
in a pull request, or you are following it.
More information about the pypy-commit
mailing list