altdesktop / python-dbus-next

🚌 The next great DBus library for Python with asyncio support
https://python-dbus-next.readthedocs.io/en/latest/
MIT License
187 stars 59 forks source link

Add __repr__ for introspection classes #72

Closed rytilahti closed 3 years ago

rytilahti commented 3 years ago

Makes it easier to use a debugger (or print() statements) to explore the introspection data.

acrisci commented 3 years ago

We have one of these for a Variant. All the __repr__ functions should follow the same convention.

https://github.com/altdesktop/python-dbus-next/blob/7ba68bb40b8a21fa28b02c633c066e948bb18ce4/dbus_next/signature.py#L417-L418

https://docs.python.org/3/reference/datamodel.html#object.__repr__

Also make sure to only use this for debugging. I don't want to define an exact value for these in the library contract.