Adjust Python bindings for SWIG >= 4.4.#280
Conversation
Function signature changed in SWIG 4.4. Details: numpy/numpy@1e424da
|
Hi! Let's say the API change is a bit unfortunate. Based on the commit mentioned, the 0 is correct. However, I believe the previous version should use |
|
Hi, thanks for looking into this. Here, you can see similar, using NULL. They haven't removed the Python 2 guard (yet?). |
|
Hi! Yes, that's correct. But the PR as submitted uses |
Krakonos
left a comment
There was a problem hiding this comment.
The change is correct. The only reservation I have is to fix the nullptr -> NULL, but that was not the scope of this PR.
|
Based on the change that introduced this in Swig 4.4, I think it's expected to return -1 on failure rather than 0: swig/swig@6c3bc2d Because the value will be used in this if: |
Function signature changed in SWIG 4.4. Details:
numpy/numpy@1e424da
Could maybe use NULL instead of nullptr; they should be the same with SWIG < 4.4.
Minor detail. Not sure what's better.