Rev 4094: compare types with is not '=' (Benjamin Peterson) in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Mon Mar 9 02:31:26 GMT 2009


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 4094
revision-id: pqm at pqm.ubuntu.com-20090309023123-7hvnfrilrt5ql771
parent: pqm at pqm.ubuntu.com-20090309012441-h1bw0tqilra3v4vy
parent: ian.clatworthy at canonical.com-20090310013607-5ah4560nqjvxqcf3
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Mon 2009-03-09 02:31:23 +0000
message:
  compare types with is not '=' (Benjamin Peterson)
modified:
  bzrlib/errors.py               errors.py-20050309040759-20512168c4e14fbd
  bzrlib/knit.py                 knit.py-20051212171256-f056ac8f0fbe1bd9
  bzrlib/multiparent.py          __init__.py-20070410133617-n1jdhcc1n1mibarp-1
  bzrlib/remote.py               remote.py-20060720103555-yeeg2x51vn0rbtdp-1
  bzrlib/xml8.py                 xml5.py-20050907032657-aac8f960815b66b1
    ------------------------------------------------------------
    revno: 4090.2.1
    revision-id: ian.clatworthy at canonical.com-20090310013607-5ah4560nqjvxqcf3
    parent: pqm at pqm.ubuntu.com-20090308222317-d1nw017gzfen1aqs
    parent: benjamin at python.org-20090307204534-5sxqxn5di37bquae
    committer: Ian Clatworthy <ian.clatworthy at canonical.com>
    branch nick: ianc-integration
    timestamp: Tue 2009-03-10 11:36:07 +1000
    message:
      compare types with is not '=' (Benjamin Peterson)
    modified:
      bzrlib/errors.py               errors.py-20050309040759-20512168c4e14fbd
      bzrlib/knit.py                 knit.py-20051212171256-f056ac8f0fbe1bd9
      bzrlib/multiparent.py          __init__.py-20070410133617-n1jdhcc1n1mibarp-1
      bzrlib/remote.py               remote.py-20060720103555-yeeg2x51vn0rbtdp-1
      bzrlib/xml8.py                 xml5.py-20050907032657-aac8f960815b66b1
    ------------------------------------------------------------
    revno: 4088.3.1
    revision-id: benjamin at python.org-20090307204534-5sxqxn5di37bquae
    parent: pqm at pqm.ubuntu.com-20090306214205-sa9k572tezp8s0a1
    committer: Benjamin Peterson <benjamin at python.org>
    branch nick: compare-types
    timestamp: Sat 2009-03-07 14:45:34 -0600
    message:
      compare types with 'is' not ==
    modified:
      bzrlib/errors.py               errors.py-20050309040759-20512168c4e14fbd
      bzrlib/knit.py                 knit.py-20051212171256-f056ac8f0fbe1bd9
      bzrlib/multiparent.py          __init__.py-20070410133617-n1jdhcc1n1mibarp-1
      bzrlib/remote.py               remote.py-20060720103555-yeeg2x51vn0rbtdp-1
      bzrlib/xml8.py                 xml5.py-20050907032657-aac8f960815b66b1
=== modified file 'bzrlib/errors.py'
--- a/bzrlib/errors.py	2009-03-03 04:49:50 +0000
+++ b/bzrlib/errors.py	2009-03-07 20:45:34 +0000
@@ -154,7 +154,7 @@
                )
 
     def __eq__(self, other):
-        if self.__class__ != other.__class__:
+        if self.__class__ is not other.__class__:
             return NotImplemented
         return self.__dict__ == other.__dict__
 

=== modified file 'bzrlib/knit.py'
--- a/bzrlib/knit.py	2009-03-09 00:36:38 +0000
+++ b/bzrlib/knit.py	2009-03-09 02:31:23 +0000
@@ -966,7 +966,7 @@
         else:
             options.append('fulltext')
             # isinstance is slower and we have no hierarchy.
-            if self._factory.__class__ == KnitPlainFactory:
+            if self._factory.__class__ is KnitPlainFactory:
                 # Use the already joined bytes saving iteration time in
                 # _record_to_data.
                 size, bytes = self._record_to_data(key, digest,

=== modified file 'bzrlib/multiparent.py'
--- a/bzrlib/multiparent.py	2008-06-11 04:20:16 +0000
+++ b/bzrlib/multiparent.py	2009-03-07 20:45:34 +0000
@@ -290,7 +290,7 @@
             ' %(num_lines)r)' % self.__dict__
 
     def __eq__(self, other):
-        if self.__class__ != other.__class__:
+        if self.__class__ is not other.__class__:
             return False
         return (self.__dict__ == other.__dict__)
 

=== modified file 'bzrlib/remote.py'
--- a/bzrlib/remote.py	2009-03-06 12:01:51 +0000
+++ b/bzrlib/remote.py	2009-03-07 20:45:34 +0000
@@ -499,7 +499,7 @@
         return 'bzr remote repository'
 
     def __eq__(self, other):
-        return self.__class__ == other.__class__
+        return self.__class__ is other.__class__
 
     def check_conversion_target(self, target_format):
         if self.rich_root_data and not target_format.rich_root_data:
@@ -710,7 +710,7 @@
         return result
 
     def has_same_location(self, other):
-        return (self.__class__ == other.__class__ and
+        return (self.__class__ is other.__class__ and
                 self.bzrdir.transport.base == other.bzrdir.transport.base)
 
     def get_graph(self, other_repository=None):

=== modified file 'bzrlib/xml8.py'
--- a/bzrlib/xml8.py	2009-03-06 20:43:58 +0000
+++ b/bzrlib/xml8.py	2009-03-07 20:45:34 +0000
@@ -92,7 +92,7 @@
     # to check if None, rather than try/KeyError
     text = _map.get(unicode_or_utf8_str)
     if text is None:
-        if unicode_or_utf8_str.__class__ == unicode:
+        if unicode_or_utf8_str.__class__ is unicode:
             # The alternative policy is to do a regular UTF8 encoding
             # and then escape only XML meta characters.
             # Performance is equivalent once you use cache_utf8. *However*
@@ -128,7 +128,7 @@
     # This is fairly optimized because we know what cElementTree does, this is
     # not meant as a generic function for all cases. Because it is possible for
     # an 8-bit string to not be ascii or valid utf8.
-    if a_str.__class__ == unicode:
+    if a_str.__class__ is unicode:
         return _encode_utf8(a_str)
     else:
         return intern(a_str)




More information about the bazaar-commits mailing list