Re: pygobject and buffers



On Thu, Sep 4, 2014 at 1:49 AM,  <jcupitt gmail com> wrote:
Does pygobject support buffers? How have other people done this? I
couldn't find any reference to "Buffer" in the C sources in a quick
search. I'm probably being dumb.

There are some preliminary sketches here [1] but at the moment a
custom C extension is as Matthias mentioned. The C extension functions
can be patched into your GI API along with a Python override to
provide a unified API. We actually do this in the core bindings in
some cases. As an example GLib.Variant.new_tuple() is a statically
bound Python extension function patched onto the introspection exposed
GLib.Variant class. See [2] and [3].

-Simon

[1] https://bugzilla.gnome.org/show_bug.cgi?id=709976
[2] https://git.gnome.org/browse/pygobject/tree/gi/overrides/GLib.py?id=3.13.91#n460
[3] https://git.gnome.org/browse/pygobject/tree/gi/gimodule.c?id=3.13.91#n472


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]