aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/udfs/common/python/bindings/py_utils.h
blob: 0c5ef058f1a9e13c7fd13c4221994094422600b9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#pragma once

#include "py_ptr.h"

#include <util/generic/strbuf.h>

#ifdef _win_
#define INIT_MEMBER(member, value) value //member
#else
#define INIT_MEMBER(member, value) .member = (value)
#endif

namespace NPython {

TPyObjectPtr PyRepr(TStringBuf asciiStr, bool intern = false);

template <size_t size>
TPyObjectPtr PyRepr(const char(&str)[size]) {
    return PyRepr(TStringBuf(str, size - 1), true);
}

TString PyObjectRepr(PyObject* value);

bool HasEncodingCookie(const TString& source);

void PyCleanup();

} // namspace NPython