Numpy compatibility issue (python 2.6)

Carl Banks pavlovevidence at gmail.com
Thu Apr 30 01:05:12 CEST 2009


On Apr 29, 5:18 am, bruno <bruno.simmena... at gmail.com> wrote:
> It seems that some TypeError messages have changed between versions
> 2.5 and 2.6, e.g.:
>
> from math import radians
> radians ()
>
> in 2.5, this leads to "radians () takes exactly 1 argument (0 given)"
> whereas in 2.6, the message is now: "radians () takes exactly one
> argument (0 given)"
>
> I agree that the two messages do have quite similar meanings, but the
> 2.6 message can no longer be "interpreted" by the _get_nargs function
> (in numpy/lib/function_base.py) As a result, you can no longer define
> (same example):
> v_radians = numpy.vectorize (radians)
>
> Anyone already confronted to this problem?

I would file a bug report on numpy issue tracker.  The bug is on their
end for trying to parse error messages.  However, given that there's
no other option in this case, and that the workaround should be pretty
easy (I doubt any numbers but one are typed out, and it should be no
problem to special-case that), it should be fixed there.


Carl Banks



More information about the Python-list mailing list