Ben Finney wrote: > Well that just begs the question: what's a good way (or a Right Way, > if that exists) to write a __str__ for a complex class?
Whatever is most useful for the programmer during debugging. > An idempotent __repr__ output seem to be the ideal, but as you say, > there are many classes for which it's impossible. What to do in those > cases? What's the Right Way? What's the common way? There is no right way. The common way is to have __str__ print something meaningful and useful. What that is for a particular class depends entirely on the circumstances. There is no uniform solution here. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis We must all hang together, or, most assuredly, we will all hang separately. -- John Hancock -- http://mail.python.org/mailman/listinfo/python-list