Dealing with the __str__ method in classes with lots of attributes

Andreas Tawn andreas.tawn at ubisoft.com
Fri May 11 11:10:50 EDT 2012


> > It's also helpful to not have to display every attribute, of which there may be
> dozens.
> 
> Do I detect a code smell here?

Possibly. I'll often try to subdivide into several simpler types, but sometimes that makes the code more complex than it needs to be.



More information about the Python-list mailing list