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).
This commit is contained in:
Jason Rhinelander 2016-11-22 05:28:40 -05:00 committed by Wenzel Jakob
parent c4d8196607
commit 7146d6299c
2 changed files with 2 additions and 2 deletions

View File

@ -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 += ", ";
}

View File

@ -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'
"""