Commit 7146d629 by Jason Rhinelander Committed by Wenzel Jakob

Changed "Invoked with" output to use repr() instead of str() (#518)

This gives more informative output, often including the type (or at
least some hint about the type).
parent c4d81966
......@@ -509,7 +509,7 @@ protected:
msg += "\nInvoked with: ";
auto args_ = reinterpret_borrow<tuple>(args);
for (size_t ti = overloads->is_constructor ? 1 : 0; ti < args_.size(); ++ti) {
msg += static_cast<std::string>(pybind11::str(args_[ti]));
msg += pybind11::repr(args_[ti]);
if ((ti + 1) != args_.size() )
msg += ", ";
}
......
......@@ -96,7 +96,7 @@ def test_str_issue(msg):
1. m.issues.StrIssue(arg0: int)
2. m.issues.StrIssue()
Invoked with: no, such, constructor
Invoked with: 'no', 'such', 'constructor'
"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment