In order to easily inspect the a Layout instance of a widget, it'd be very useful to have a representation which displays all attributes.
This way one can better understand the current layout.
Proposed Solution
A simple method which collects all attributes and formats them to a string:
def __str__(self):
attributes = []
for key, value in self.__dict__.items():
if not key.startswith('_'):
attributes.append(f"{key}={value}")
return f"Layout({', '.join(attributes)})"
Problem
In order to easily inspect the a Layout instance of a widget, it'd be very useful to have a representation which displays all attributes. This way one can better understand the current layout.
Proposed Solution
A simple method which collects all attributes and formats them to a string: