Skip to content

Make dtype::num() return type consistent with other functions#3995

Merged
Skylion007 merged 1 commit intopybind:masterfrom
MaartenBaert:dtype-num-return-type
Jun 6, 2022
Merged

Make dtype::num() return type consistent with other functions#3995
Skylion007 merged 1 commit intopybind:masterfrom
MaartenBaert:dtype-num-return-type

Conversation

@MaartenBaert
Copy link
Contributor

Description

Pybind uses int to represent dtype numbers everywhere in the API, except for the newly added dtype::num() function, which for some reason uses ssize_t. This commit fixes that and makes it consistent with the other functions.

@Skylion007
Copy link
Collaborator

Skylion007 commented Jun 6, 2022 via email

@rwgk
Copy link
Collaborator

rwgk commented Jun 6, 2022

WHAT IS THE TYPE OF return detail::array_descriptor_proxy(m_ptr)->type_num ;

On Mon, Jun 6, 2022 at 4:24 PM Maarten Baert @.> wrote: Description Pybind uses int to represent dtype numbers everywhere in the API, except for the newly added dtype::num() function, which for some reason uses ssize_t. This commit fixes that and makes it consistent with the other functions. ------------------------------ You can view, comment on, or merge this pull request online at: #3995 Commit Summary - 2c91f4d <2c91f4d> Make dtype::num() return type consistent with other functions File Changes (1 file https://github.com/pybind/pybind11/pull/3995/files) - M include/pybind11/numpy.h https://github.com/pybind/pybind11/pull/3995/files#diff-32496cc1f174bae1792ee91e0228cb198995509d66c039d64a3739f9c777cf10 (2) Patch Links: - https://github.com/pybind/pybind11/pull/3995.patch - https://github.com/pybind/pybind11/pull/3995.diff — Reply to this email directly, view it on GitHub <#3995>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAPVMX2ROM52PIPR4KGGKYTVNZNA5ANCNFSM5YATE5CA . You are receiving this because you are subscribed to this thread.Message ID: @.>

It's int:

int type_num;

When reviewing PR #3868 I missed this mismatch. LGTM, but @MaartenBaert, how did you find this? Did it break anything? It would be good to explain in the PR description.

@Skylion007 Skylion007 merged commit 918892b into pybind:master Jun 6, 2022
@github-actions github-actions bot added the needs changelog Possibly needs a changelog entry label Jun 6, 2022
@MaartenBaert
Copy link
Contributor Author

LGTM, but @MaartenBaert, how did you find this? Did it break anything? It would be good to explain in the PR description.

It didn't break anything, I just noticed the mismatch between the new constructor and the num() function.

@henryiii henryiii removed the needs changelog Possibly needs a changelog entry label Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants