mirror of
https://github.com/pybind/pybind11.git
synced 2026-06-06 06:51:58 +00:00
Replace std::cout with py::print in tests
With this change both C++ and Python write to sys.stdout which resolves the capture issues noted in #351. Therefore, the related workarounds are removed.
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
#include <pybind11/numpy.h>
|
||||
|
||||
double my_func(int x, float y, double z) {
|
||||
std::cout << "my_func(x:int=" << x << ", y:float=" << y << ", z:float=" << z << ")" << std::endl;
|
||||
py::print("my_func(x:int={}, y:float={:.0f}, z:float={:.0f})"_s.format(x, y, z));
|
||||
return (float) x*y*z;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user