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

support docstrings in enum:_:value() #1160

Merged
merged 3 commits into from Nov 16, 2017
Merged

support docstrings in enum:_:value() #1160

merged 3 commits into from Nov 16, 2017

Conversation

wjakob
Copy link
Member

@wjakob wjakob commented Oct 29, 2017

This PR fixes #1136 by adding an optional docstring for each value of an enumeration so that they can be documented in a way that is analogous to classes, methods, properties, etc.

I'm not 100% happy happy with the change because it ends up adding even more code that is instantiated for each enumeration. A longer-term change that would be nice to do is to refactor enumeration so that there is a top-level class enum_base class (analogous to pybind11_object) which contains genereric versions of all methods and thin wrappers that are instantiated for each concrete enumeration.

@jagerman
Copy link
Member

jagerman commented Nov 2, 2017

LGTM. I agree that enums could use an overhaul, but this seems a reasonable short-term solution.

@wjakob wjakob merged commit 6d19036 into pybind:master Nov 16, 2017
0 of 2 checks passed
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