You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At least, in python2 (where isinstance(True, int) is True) If I try to serialize {1: True, 2:False} as DBUS's variant, it is really serialized as {1: 1, 2:0}.
And also txdbus allows mix of types in such dicts., for example, {1:'s', 'd': True}
The text was updated successfully, but these errors were encountered:
Looks like this may have been a simple oversight in the marshalling logic.
Try adding "elif isinstance(pobj, bool): return 'b'" to line 243 of
txdbus/marshal.py and see if that resolves the issue. Doing so didn't break
any of the unit tests but it's been several years since I've thought about
this code so most of the details have gone fuzzy. Let me know what happens.
As to the mixed types in dictionaries, that was partially intentional. It's
an efficiency condition where I can either check a single element or
iterate over all elements to ensure that all types match. I went back and
forth on it and figured that it's more of a programming bug that wasn't
worth a continual runtime penalty to constantly check. It's definitely
debatable though as to whether or not that's the best choice.
At least, in python2 (where
isinstance(True, int)
isTrue
) If I try to serialize{1: True, 2:False}
as DBUS's variant, it is really serialized as{1: 1, 2:0}
.And also txdbus allows mix of types in such dicts., for example,
{1:'s', 'd': True}
The text was updated successfully, but these errors were encountered: