[Tutor] Class attributes

Timothy M. Brauch tbrauch@tbrauch.com
Sun, 7 Jul 2002 03:27:09 -0400


>
> >>> class BigClass:
> ...   def __str__(self):
> ...     return '[%s, %s]' % (self.a, self.b)

I see, I was leaving out the quotes.  __str__ only works when you return a
string.  It makes sense.  In fact, I think I knew that, but for some reason
it just wasn't sinking in when I coded it.

 - Tim