[Numpy-discussion] Remove numpy/compat/_inspect.py ?

Charles R Harris charlesr.harris at gmail.com
Fri Aug 1 22:17:09 EDT 2014


On Fri, Aug 1, 2014 at 8:01 PM, David Cournapeau <cournape at gmail.com> wrote:

> On my machine, if I use inspect instead of _inspect in
> numpy.compat.__init__, the import time increases ~ 25 % (from 82 ms to 99
> ms).
>
> So the hack certainly still make sense, one just need to fix whatever
> needs fixing (I am still not sure what's broken for the very specific
> usecase that code was bundled for).
>
>
I'm not sure a one time hit of 17 ms is worth fighting for ;) The problems
were that both the `string` and `dis` modules were used without importing
them. Evidently those code paths were never traversed, so I removed the
code using `dis` and raised an error there instead, it was for parsing
tuple arguments. The string.join was fixed using the string method.

<snip>

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20140801/40d5a748/attachment.html>


More information about the NumPy-Discussion mailing list