Simplify repr() function

This commit is contained in:
xtemp09
2025-08-15 18:25:45 +07:00
committed by Chris Hennes
parent 67178b953d
commit 887e7bd595
15 changed files with 33 additions and 87 deletions

View File

@@ -167,10 +167,7 @@ PythonDebugStdout::~PythonDebugStdout() = default;
Py::Object PythonDebugStdout::repr()
{
std::string s;
std::ostringstream s_out;
s_out << "PythonDebugStdout";
return Py::String(s_out.str());
return Py::String("PythonDebugStdout");
}
Py::Object PythonDebugStdout::write(const Py::Tuple& args)
@@ -210,10 +207,7 @@ PythonDebugStderr::~PythonDebugStderr() = default;
Py::Object PythonDebugStderr::repr()
{
std::string s;
std::ostringstream s_out;
s_out << "PythonDebugStderr";
return Py::String(s_out.str());
return Py::String("PythonDebugStderr");
}
Py::Object PythonDebugStderr::write(const Py::Tuple& args)
@@ -248,10 +242,7 @@ PythonDebugExcept::~PythonDebugExcept() = default;
Py::Object PythonDebugExcept::repr()
{
std::string s;
std::ostringstream s_out;
s_out << "PythonDebugExcept";
return Py::String(s_out.str());
return Py::String("PythonDebugExcept");
}
Py::Object PythonDebugExcept::excepthook(const Py::Tuple& args)