Numpy compatibility issue (python 2.6)

B

bruno

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?

Thanks in advance...
 
C

Carl Banks

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top