How to apply __str__ function when printing a list of objects in Python [duplicate] May 1, 2023 by Tarik Try: class Test: def __repr__(self): return 'asd' And read this documentation link: