wlav / CPyCppyy

Other
23 stars 20 forks source link

Add support for checking arguments that can be implicitly cast during overload resolution #4

Closed sudo-panda closed 1 year ago

sudo-panda commented 2 years ago

Why is #include "CPPMethod.h" needed in CPPOverload.cxx? It should be independent and only use the PyCallable base class. (I also don't see a reason in the code changes to add that include.)

For clarity: 1) use return nullptr on error return. That way there is no mistake in error returns in case newmeth happens to be set, as can be done now. 2) if newmeth declaration is put at initializatioon, then that reduces the chance for bugs later. 3) Don't use magic 10 * n to drive logic. From reading, that magic is simply saying "no matching score found, as all were INT_MAX." Simply use an additional boolean variable for that.

Fixed!

sudo-panda commented 2 years ago

Added some more changes to reduce coupling.