Hi,
On 30 January 2015 at 05:26, anatoly techtonik <
tech...@gmail.com> wrote:
> That works, thanks. Why it can not be done automatically?
Because nothing says that a `const char *` must point to a
null-terminated string. There are cases where you want to get a real
pointer to one character.
The "CFFI way" differs from the "ctypes way" in that CFFI has much
less bells and whistles. For any CFFI project that is supposed to be
used more than once, you are supposed to wrap the cffi-provided API
into some custom API of your choice in pure Python, like functions or
classes-and-methods that expose to the user some really Pythonic API
instead of the cdata objects.
You can disagree with the approach, of course; then ctypes is better for you :-)
A bientôt,
Armin.