Template Function lsst::utils::python::addOutputOp¶
Function Documentation¶
-
template<class
PyClass
>
voidlsst::utils::python
::
addOutputOp
(PyClass &cls, std::string const &method)¶ Add
__str__
or__repr__
method implemented byoperator<<
.For flexibility, this method can be used to define one or both of
__str__
and__repr__
. It can also be used to define any Python method that takes no arguments and returns a string, regardless of name.- Template Parameters
PyClass
: The pybind11 class_ type. The wrapped class must support << as a stream output operator.
- Parameters
cls
: ThePyClass
object to which to add a wrapper.method
: The name of the method to implement. Should be"__str__"
or"__repr__"
.