Problems with empty Arrays and Dicts in untyped languages

John (J5) Palmieri johnp at
Thu Jul 28 04:31:56 EST 2005

There is a problem in the current protocol when sending empty arrays and
dicts from untyped languages.  Basicly in the python bindings we check
the first element of the list to guess its type but without any element
we can not do so.  I am already crafting a way to hint list and dict
signitures but this means people will have to either explicitly cast
every time they use a list or they will have to special case for empty
lists which is ugly.

Would it be wrong to add a special type EmptyArray to the protocol which
would not need a signature and would correctly map to an array of
anytype?  I know we didn't want to add logic to the bus when dealing
with types but this would make it much easier to support in untyped
language bindings.

One other point is Introspection makes this argument moot but there are
times when using introspection may be turned off in the client (less
round trips).

John (J5) Palmieri <johnp at>

More information about the dbus mailing list