[Checkins] SVN: zope.app.keyreference/trunk/ performance fix for KeyReferenceToPersistent.

Wichert Akkerman wichert at wiggy.net
Thu Aug 14 17:31:29 EDT 2008


Previously Alex Smith wrote:
> Modified: zope.app.keyreference/trunk/src/zope/app/keyreference/persistent.py
> ===================================================================
> --- zope.app.keyreference/trunk/src/zope/app/keyreference/persistent.py	2008-08-14 20:18:50 UTC (rev 89843)
> +++ zope.app.keyreference/trunk/src/zope/app/keyreference/persistent.py	2008-08-14 21:28:39 UTC (rev 89844)
> @@ -61,7 +61,7 @@
>  
>      def __cmp__(self, other):
>          if self.key_type_id == other.key_type_id:
> -            if isinstance(self.object, PersistentReference):
> +            if type(self.object) is PersistentReference:
>                  # we are doing conflict resolution.
>                  assert isinstance(other.object, PersistentReference), (
>                      'other object claims to be '

Won't that break now if you have something uses a class derived from
PersistentReference ? Or is that something that can never happen?

Wichert.

-- 
Wichert Akkerman <wichert at wiggy.net>    It is simple to make things.
http://www.wiggy.net/                   It is hard to make things simple.


More information about the Checkins mailing list