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

Conversation

Projects
None yet
2 participants
@wjakob
Copy link
Member

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.

@wjakob wjakob force-pushed the wjakob:master branch from 48566f7 to 0f17cc3 Oct 29, 2017

@jagerman

This comment has been minimized.

Copy link
Member

commented Nov 2, 2017

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

wjakob added some commits Nov 16, 2017

@wjakob wjakob merged commit 6d19036 into pybind:master Nov 16, 2017

0 of 2 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.