Mikael Olofsson a écrit : > Bruno Desthuilliers wrote: >> def __str__(self): >> return "<%s:%s>" % (self.commiterID_, self.commits_) > > I would write that in the following way: > > def __str__(self): > return "<%(commiterID_)s:%(commits_)s>" % self.__dict__ > > More explicit IMHO. And easier to maintain, especially if the string > would contain several insertions.
Agreed. Well, at least until you want to access something that's not in the instance's __dict__ !-) -- http://mail.python.org/mailman/listinfo/python-list