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

Overriding field names when binding structured dtypes #474

Merged
merged 2 commits into from
Nov 3, 2016

Conversation

aldanor
Copy link
Member

@aldanor aldanor commented Nov 1, 2016

This is a very small but useful addition -- PYBIND11_NUMPY_DTYPE_EX() can be used to provide custom names to exported fields. Since it's quite common in C++ to have suffices/prefices (e.g. underscores) for private members, this allows to easily overcome this ugliness when exporting types to numpy.

The example can be seen in the added test.

@wjakob
Copy link
Member

wjakob commented Nov 3, 2016

Ok -- looks good to me. Please don't forget to add documentation for this and the other NumPy changes :)

@wjakob wjakob merged commit a743ead into pybind:master Nov 3, 2016
@aldanor
Copy link
Member Author

aldanor commented Nov 3, 2016

Yep, also will need to scan the several latest months for changes and add them to change log, lots of stuff is missing from there. Maybe we'll need to break release notes for 2.x in subsections, too.

@aldanor
Copy link
Member Author

aldanor commented Nov 3, 2016

On a side note, I've definitely gained a few levels in higher-kinded C macros ))

@wjakob
Copy link
Member

wjakob commented Nov 3, 2016

heh, yes -- and in writing portable ones ;). Regarding changelog: it's indeed starting to look that way. Not a bad thing though, v2.0 will be an exciting release.

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.

2 participants