launchpad-dev team mailing list archive
-
launchpad-dev team
-
Mailing list archive
-
Message #02556
Re: Give your models some repr love!
On Feb 11, 2010, at 05:07 PM, Jonathan Lange wrote:
>On Thu, Feb 11, 2010 at 5:00 PM, Tom Berger <tom.berger@xxxxxxxxxxxxx> wrote:
>> 1. The default repr is unique. Should we try and preserve that?
>
>As a rule of thumb, I try to have repr(a) == repr(b) <==> (a == b),
>rather than (a is b). I don't know if that's standard or helps.
Yep. I think because reprs are strings they should be compared by equality
instead of identity.
-Barry
Attachment:
signature.asc
Description: PGP signature
References