asPyBytes method

PythonString asPyBytes()

Converts a String to a python bytes object

Implementation

PythonString asPyBytes() {
  final allocated = toNativeUtf8();
  return PythonString(
      dartpyc.PyBytes_FromString(allocated.cast<Char>()), allocated);
}