Opened 6 years ago

Closed 6 years ago

#506 closed defect (fixed)

doctest failure in cpp_classes.pyx

Reported by: craigcitro Owned by: craigcitro
Priority: major Milestone: 0.13
Component: C++ Keywords:


I ran into the following doctest failure with the current cython-devel (i.e. after the C++ merge):

AssertionError: None != u"44:33: Invalid conversion from 'Python object' to 'int'"

This comes down to not falling into the "right" case in the best_match function in Cython/Compiler/ The attached patch cleans this function up a bit, and adds a few comments. I'm happy to commit, but wouldn't mind one more set of eyes first.

(Even with this patch, there's still one issue I'm confused about: int.assignable_from(object) is returning False. My off-the-cuff guess would have been the opposite; if so, someone should open another ticket and assign it to me.)

Attachments (1)

cython_trac_506.patch (6.0 KB) - added by craigcitro 6 years ago.

Download all attachments as: .zip

Change History (6)

Changed 6 years ago by craigcitro

comment:1 Changed 6 years ago by robertwb

The reason to use func_type rather than func.type is that func.type may be a pointer to a function, rather than the function itself.

comment:2 Changed 6 years ago by craigcitro

Ah, I missed one or two occurrences of func_type below. I just passed it down from the top for loop, and pushed the change:

comment:3 Changed 6 years ago by craigcitro

comment:4 Changed 6 years ago by robertwb

  • Owner changed from somebody to craigcitro

comment:5 Changed 6 years ago by robertwb

  • Resolution set to fixed
  • Status changed from new to closed

This was fixed and merged.

Note: See TracTickets for help on using tickets.