FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

BUG: fix signature of PyArray_SearchSorted in __init__.pxd by mattip · Pull Request #16223 · numpy/numpy · GitHub

/ numpy Public

BUG: fix signature of PyArray_SearchSorted in __init__.pxd - #16223

Merged
charris merged 1 commit into
numpy:masterfrom
mattip:pxd-fix
May 13, 2020
Merged

charris merged 1 commit into
numpy:masterfrom
mattip:pxd-fix

Conversation

mattip commented May 13, 2020

Copy link
Copy Markdown
Member

Fixes gh-16219

Not to delay this PR, but I wonder if we could somehow write a test that checks all the signatures, and checks that all the API functions appear in __init__.pxd, kind of like the way we check the API hashes

charris merged commit 56f444a into numpy:master May 13, 2020

charris commented May 13, 2020

Copy link
Copy Markdown
Member

Thanks Matti. I agree that it would be good to have an automated check for these.

Copy link
Copy Markdown
Contributor

have you tested this locally? when i tried this in cython/cython#3606 i found i needed to use PyObject* rather than object for the fourth arg

mattip commented May 13, 2020

Copy link
Copy Markdown
Member Author

No I did not, in fact we only consume cython internally in the random module.

mattip commented May 13, 2020

Copy link
Copy Markdown
Member Author

I guess backing this PR out will not really solve the problem: the signature will still be wrong

seberg commented May 13, 2020

Copy link
Copy Markdown
Member

How come the difference? To be able to pass NULL? I always get a bit confused, in the signature that does not have an effect on the reference counts does it?

charris commented Jul 1, 2020
edited
Loading

Copy link
Copy Markdown
Member

@scoder See #16720.

scoder commented Jul 1, 2020

Copy link
Copy Markdown
Contributor

in the signature that does not have an effect on the reference counts does it?

No, it's an input argument, so the ref-count does not change. However, an object cannot be NULL, because that signals an exception and therefore Cython does not allow object arguments to be NULL. You have to use PyObject* here to allow the argument "not to be passed".

charris added a commit to charris/numpy that referenced this pull request Jul 1, 2020
See comment on merged PR numpy#16223. The `perm` variable may be NULL,
so cannot be passed as object.
charris added a commit to charris/numpy that referenced this pull request Jul 1, 2020
See comment on merged PR numpy#16223. The `perm` variable may be NULL,
so cannot be passed as object.
mattip deleted the pxd-fix branch April 8, 2021 11:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The PyArray_SearchSorted function has wrong signature in __init__.pxd

5 participants


Back | FazBrowse Home | New Git URL