summaryrefslogtreecommitdiff
path: root/docs/examples/tutorial/string/cpp_string.pyx
blob: b6c9e44f93c6be6cace77d11895e6e691e274f25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
# distutils: language = c++

from libcpp.string cimport string

def get_bytes():
    py_bytes_object = b'hello world'
    cdef string s = py_bytes_object

    s.append('abc')
    py_bytes_object = s
    return py_bytes_object