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