On 12 February 2010 03:51, Barry Warsaw <[email protected]> wrote: > It's easy to do, too. E.g. I have a branch hopefully landing soon that adds > this to class Language: > > def __repr__(self): > return '<Language: %s>' % self.displayname > > A word of warning though: adding a repr to existing classes can break doctests > far from the models you're modifying, so land such branches through ec2.
My normal practice is to use self.__class__.__name__ to avoid confusion if it's later subclassed... -- Martin <http://launchpad.net/~mbp/> _______________________________________________ Mailing list: https://launchpad.net/~launchpad-dev Post to : [email protected] Unsubscribe : https://launchpad.net/~launchpad-dev More help : https://help.launchpad.net/ListHelp

