Ticket #506 (closed defect: fixed)

Opened 5 years ago

Last modified 4 years ago

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/PyrexTypes.py. 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.)


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

Change History

Changed 5 years ago by craigcitro

Changed 5 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.

Changed 5 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:


Changed 5 years ago by craigcitro

Changed 4 years ago by robertwb

  • owner changed from somebody to craigcitro

Changed 4 years ago by robertwb

  • status changed from new to closed
  • resolution set to fixed

This was fixed and merged.

Note: See TracTickets for help on using tickets.