Hi,
On 15 February 2017 at 22:09, M P <
bmpe...@gmail.com> wrote:
> - Will CFFI ever have support for mixed-key arrays?
> - What can we do to bridge this gap between the types?
In C, there are no string keys and no negative indexes. So that means
that CFFI does not support them either, and never will. For example,
there is no single standard for how string-keys can work in a C-like
setting.
The usual way is to add a pure Python class around the raw cdata
objects, and have your own ``__getitem__()`` method that does whatever
is needed. In general, you should consider cffi's cdata objects as
"internal", and not expose them to the user of the library; instead,
you expose an API that is more Pythonic. In this case, supporting
more methods, string keys, etc.
A bientôt,
Armin.