Skip to content

Fix implicit conversion of accessors to types derived from py::object #1076

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

Merged
merged 1 commit into from
Sep 11, 2017

Conversation

dean0x7d
Copy link
Member

Fixes #1069.

py::dict d = obj.attr("__dict__");

This code requires two implicit conversions, detail::accessor -> py::object -> py::dict, but the standard only allows one implicit conversion for user-defined types. It would be strange for the code above to fail to compile, so this PR adds an extra converting ctor to types derived from py::object.

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.

1 participant