-
Notifications
You must be signed in to change notification settings - Fork 2.2k
operators: Explicitly expose py::hash(py::self)
#2217
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
operators: Explicitly expose py::hash(py::self)
#2217
Conversation
44086d2
to
f8a1099
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me!
If easy: may be nice to undo whitespace formatting change after line 48 (old) of test_operator_overloading.py, so that it is obvious that the values aren't changed by this PR. (I'd also remove the extra empty line at the end.)
@rwgk Thanks! However, it was still a tad hard for me to "add" in the new value b/c of whitespace changes. |
Only what you feel is easy and reasonable. It's nice to minimize
distracting whitespace diffs but only if the effort to achieve that is
reasonable.
…On Thu, May 21, 2020 at 12:35 PM Eric Cousineau ***@***.***> wrote:
@rwgk <https://github.com/rwgk> Thanks! However, it was still a tad hard
for me to "add" in the new value b/c of whitespace changes.
Would it be OK if I instead curated my commits?
e.g. make minimal set of whitespace changes, no functional changes, and
then add the functional change on top of that? Then bisecting / git history
would be preserved!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2217 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFUZADYFBIYETHMP2GMUATRSV67XANCNFSM4NEMV7PQ>
.
|
f8a1099
to
e4e62b3
Compare
Add warnings about extending STL
e4e62b3
to
2723387
Compare
Took about 3min to split the commits apart (and make sure each one tested correctly). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Eric!
Looks great, thanks @EricCousineau-TRI and @rwgk for the review! |
Add warnings about extending STL
When using
pybind11
for Drake, I found that I had to write:instead of what the unittest wrote:
pybind11/tests/test_operator_overloading.cpp
Line 110 in a54eab9
This explicitly exposes the overload in the
pybind11
namespace.Additionally, I was mislead into thinking that you may be able to overload
std::abs
. Per these docs, it does not appear to be valid (nor could I get it to work straight off the bat):https://en.cppreference.com/w/cpp/language/extending_std
Follow-up to #1034