• Jason Rhinelander's avatar
    Fix debugging output for nameless py::arg_v annotations (#648) · 1eaacd19
    Jason Rhinelander authored
    * Fix debugging output for nameless py::arg annotations
    
    This fixes a couple bugs with nameless py::arg() (introduced in #634)
    annotations:
    
    - the argument name was being used in debug mode without checking that
      it exists (which would result in the std::string construction throwing
      an exception for being invoked with a nullptr)
    - the error output says "keyword arguments", but py::arg_v() can now
      also be used for positional argument defaults.
    - the debugging output "in function named 'blah'" was overly verbose:
      changed it to just "in function 'blah'".
    
    * Fix missing space in debug test string
    
    * Moved tests from issues to methods_and_attributes
    1eaacd19
test_methods_and_attributes.cpp 13.9 KB