Numpy compatibility issue (python 2.6)

Discussion in 'Python' started by bruno, Apr 29, 2009.

  1. bruno

    bruno Guest

    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...
    bruno, Apr 29, 2009
    #1
    1. Advertising

  2. bruno

    Carl Banks Guest

    On Apr 29, 5:18 am, bruno <> 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
    Carl Banks, Apr 30, 2009
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. drife
    Replies:
    1
    Views:
    359
    Travis E. Oliphant
    Mar 1, 2006
  2. Duncan Smith
    Replies:
    3
    Views:
    416
    Duncan Smith
    Apr 25, 2007
  3. Replies:
    2
    Views:
    486
    Robert Kern
    Nov 13, 2007
  4. Replies:
    8
    Views:
    85
    Sturla Molden
    May 12, 2014
  5. Chris Angelico
    Replies:
    6
    Views:
    78
    Steven D'Aprano
    May 11, 2014
Loading...

Share This Page