Currently, the 'buf'-related signature types are returned after being run through ffi.string(). This returns a bytes object (equivalent to str in Python 2). However, it'd be useful to have more control. There are probably 3 common cases:
- Always
bytes
- Version-specific
str (equivalent to bytes on py2, unicode on py3)
- Always
unicode
We could introduce new names, e.g. strbuf, but that may be overly cluttered and annoying. A better solution may be to introduce a new flag for this setting, which will also allow us to do it on a per-library, per-object, and per-function level.
Currently, the
'buf'-related signature types are returned after being run throughffi.string(). This returns abytesobject (equivalent tostrin Python 2). However, it'd be useful to have more control. There are probably 3 common cases:bytesstr(equivalent tobyteson py2,unicodeon py3)unicodeWe could introduce new names, e.g.
strbuf, but that may be overly cluttered and annoying. A better solution may be to introduce a new flag for this setting, which will also allow us to do it on a per-library, per-object, and per-function level.