Inlined C code and a TypeError

Discussion in 'Python' started by Ognen Duzlevski, Jan 13, 2004.

  1. Hi all,

    I have a nested loop that is written using PyInline for speed reasons. It modifies three matrices (lists of lists
    containing integer numbers).

    Upon return from this function I run min() on values from the matrices. Below is the puzzling output:

    --
    time in nested loop: 0.250000
    403
    394
    402
    <type 'int'>
    <type 'int'>
    <type 'int'>
    Traceback (most recent call last):
    File "./primegens_old.py", line 1656, in ?
    GetSegment()
    File "./primegens_old.py", line 1499, in GetSegment
    tmp_score,sim = SeqMapping(seq[ndx1],seq[0],seqmapping,inversemapping,length[ndx1],length[0])
    File "./primegens_old.py", line 678, in SeqMapping
    minscore = min(delmat[tlen][qlen], insertmat[tlen][qlen], scoremat[tlen][qlen])
    TypeError: an integer is required
    --

    I do not understand - the numbers 403, 394 and 402 are results of printing the delmat, insertmat and
    scoremat[tlen][qlen] each. The "<type 'int'> is a result of calling type on each of these. Yet, when min is called, ot
    dies with the TypeError. Can anyone shed some light on this?

    Thank you,
    Ognen
    Ognen Duzlevski, Jan 13, 2004
    #1
    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. Andy
    Replies:
    3
    Views:
    291
  2. Alex Vinokur
    Replies:
    7
    Views:
    402
    Greg Comeau
    Nov 15, 2004
  3. Steven T. Hatton

    What gets inlined?

    Steven T. Hatton, May 30, 2005, in forum: C++
    Replies:
    15
    Views:
    623
    Steven T. Hatton
    Jun 1, 2005
  4. inline functions not inlined

    , Mar 6, 2006, in forum: C Programming
    Replies:
    9
    Views:
    324
    David Resnick
    Mar 7, 2006
  5. sks
    Replies:
    4
    Views:
    305
    Victor Bazarov
    Dec 6, 2005
Loading...

Share This Page