Can you move this back to the module level import, I don't understand why it should go here? Further up `+np.nan` is OK, but should have spaces around the +. I always need a bit to figure out what ocnt means, but I don't mind much. There is a lot to add (like the behaviour when casting), but this is at least *something* :). Further style nitpick: no spaces here `[ nested ]`, there was also in the C code on more time no spaces around the `==`. Anyway these are all just minor style nitpicks, over all I think this is good modulo someone elses opinion of the general approach.

Before this can be merged it has to be Squeezed. Best make two commits one for the tests such with a message along the lines "TST: Add basic tests for np.array" and possibly more explanation in the next lines and for the real changes something like "ENH: Optimize array creation by avoiding errors" or whatever message you feel good (with more explanation in the next lines again). But you can wait with that until others had time to look at it and comment. You can do this with interactive rebase: https://help.github.com/articles/interactive-rebase