Skip to content

Provide __str__ for dbus ints, needed for python3.8

Python 3.8 removed __str__ implementations from builtin types bool, int, float, complex and few classes from the standard library. They now inherit __str__() from object. As result, defining the __repr__() method in the subclass of these classes will affect their string representation.

Thus with python 3.8, python3 -c 'import dbus; print(str(dbus.Int32(34)))' gives dbus.Int32(34) instead of 34.

We now provide a __str__ method to dbus ints and longs to revert to the previous behaviour.

Closes #31 (closed)

Edited by Mathieu Clabaut

Merge request reports

Loading