We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9f0a880 commit 430ca86Copy full SHA for 430ca86
c++/cpp2py/misc.hpp
@@ -1,6 +1,8 @@
1
#pragma once
2
#include <vector>
3
+#include <string>
4
#include "./exceptions.hpp"
5
+#include "./pyref.hpp"
6
#include <time.h>
7
8
// silence warning on intel
@@ -11,6 +13,11 @@
11
13
12
14
namespace cpp2py {
15
16
+ inline std::string to_string(PyObject * ob){
17
+ pyref py_str = PyObject_Str(ob);
18
+ return PyUnicode_AsUTF8(py_str);
19
+ }
20
+
21
inline char *get_current_time() { // helper function to print the time in the CATCH_AND_RETURN macro
22
time_t rawtime;
23
time(&rawtime);
0 commit comments