[Baypiggies] Trip-up
Paul McNett
p at ulmcnett.com
Fri Jul 28 19:49:09 CEST 2006
(Oops, I guess I hit 'reply' and not 'reply-all' followed by removing
all but BayPiggies. I kind of miss KMail - it had a reply-list option.
Other lists I'm on mangle the reply-to so that all replies go to the
list instead of the individual. I'm used to that, but I don't know what
the best solution is.)
Dennis Reinhardt wrote:
> At 08:36 AM 7/28/2006, Paul McNett wrote:
>> >>> a = 123456
>> >>> b = 123456
>> >>> a is b
>> False
>
> But ...
> >>> a == b
> True
>
>> I guess my new mantra is
>> "never work with unbound objects..."
>
> A better mantra might be "use == to compare values"
This was simply a reduced-to-bitesize example. For value comparison, use
value comparison operators, yes I know. :)
I have a situation I've inherited where mutable objects saved in a ZODB
are actually referring to mutable objects elsewhere in the db, where
that definitely wasn't the intent (the list in object AA IS the same
list in object ZZ... ouch!) I was coming up with strategies to fix this
and other problems when I tripped myself up with the example I posted.
Time for another cup of tea!
--
Paul McNett
http://paulmcnett.com
http://dabodev.com
More information about the Baypiggies
mailing list