wlav / cppyy

Other
391 stars 40 forks source link

Issue with newlines in CPP #118

Closed Fancyapplebee closed 1 year ago

Fancyapplebee commented 1 year ago

In version 2.4.1 of cppyy, newlines require two backslashes instead of one. For example. This won't work:

cppyy.cppdef( ''' struct something { void baseLineStats() { std::cout << "as\n" ; } }; ''')

But this will work:

cppyy.cppdef( ''' struct something { void baseLineStats() { std::cout << "as\n" ; } }; ''')

wlav commented 1 year ago

Hasn't this always been the case? I.e., it's not new in 2.4.1? I also think it's the expected behavior. Anyway, Python has raw strings for this purpose: just prepend an r.