Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add nb::bytes::data() accessor #584

Merged
merged 2 commits into from
May 14, 2024
Merged

Add nb::bytes::data() accessor #584

merged 2 commits into from
May 14, 2024

Conversation

nurpax
Copy link
Contributor

@nurpax nurpax commented May 14, 2024

Add nb::bytes::data() accessor as discussed in #569 (reply in thread)

Note: I couldn't get the tests to build on Windows due to this error:

C:\Users\janne\dev\nanobind\src\nb_internals.h(22,1): fatal error C1189: #error:  nanobind depends on tsl::robin_map, i
n particular version >= 1.3.0, <2.0.0 [C:\Users\janne\dev\nanobind\build\tests\nanobind-mydomain.vcxproj]
  Generating Code...

So trying if I can get test this with CI.

@wjakob
Copy link
Owner

wjakob commented May 14, 2024

Can you replace test_functions_ext.pyi.ref with your generated test_functions_ext.pyi? If you get the robin_map error message locally, you probably need to update your subrepository.

@nurpax
Copy link
Contributor Author

nurpax commented May 14, 2024

Ahh, of course, that was it. All those years using git yet zero success in committing git submodules into CLI muscle memory.

If the change looks otherwise ok, I can add another commit for docs too.

@wjakob
Copy link
Owner

wjakob commented May 14, 2024

The change looks good, please go ahead.

@nurpax
Copy link
Contributor Author

nurpax commented May 14, 2024

Added docs. Also updated the docs for nb::bytes(const void * buf, size_t n) constructor to match the actual code.

Hopefully the rst syntax is not too wrong in my change.

@wjakob
Copy link
Owner

wjakob commented May 14, 2024

Looks all good, thanks!

@wjakob wjakob merged commit 8ab54e4 into wjakob:master May 14, 2024
24 checks passed
@nurpax nurpax deleted the bytes-data branch May 15, 2024 06:40
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.

None yet

2 participants