Proxy Objects & Interfaces In DBussy
Lawrence D'Oliveiro
ldo at geek-central.gen.nz
Thu May 25 00:53:27 UTC 2017
On Wed, 24 May 2017 13:32:40 +0100, Simon McVittie wrote:
> I consider this to be a design flaw in dbus-python: it does far too
> much introspection-guided guessing at what the client author meant,
> with the result that if the Introspect() result differs from what the
> client author was expecting, they will get weird TypeError exceptions
> that do not reflect what the actual D-Bus type mismatch is.
That’s why I offer a choice. You can construct proxy interfaces
yourself. Or use the lower-level message-construction services of the
dbussy module.
> If Introspect() is called synchronously, like any other synchronous
> method call it will block the main loop, and can result in message
> re-ordering[1], which in the worst case can break the intended
> semantics of D-Bus APIs.
That’s why coroutines are so useful.
> Introspection is mostly a development and debugging feature, and
> ideally nothing would rely on it at runtime.
Very handy for throwing together ad-hoc scripts, though. Which very
much suits many use-cases for a high-level language like Python.
More information about the dbus
mailing list