]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- PickleType will compare using `==` when set up with mutable=False,
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 18 Nov 2007 16:32:47 +0000 (16:32 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 18 Nov 2007 16:32:47 +0000 (16:32 +0000)
and not the `is` operator.  To use `is` or any other comparator, send
in a custom comparison function using PickleType(comparator=my_custom_comparator).

CHANGES
lib/sqlalchemy/types.py

diff --git a/CHANGES b/CHANGES
index ff0462814ec6323dcd966582e7d14fc14c3934a8..0018b8389358c3baa3ab4b565ac7fb11127e4a54 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -97,6 +97,10 @@ CHANGES
     only those paths, i.e. and not 'x.y.x'; eagerload('children.children')
     applies only to exactly two-levels deep, etc. [ticket:777]
 
+  - PickleType will compare using `==` when set up with mutable=False,
+    and not the `is` operator.  To use `is` or any other comparator, send
+    in a custom comparison function using PickleType(comparator=my_custom_comparator).
+    
   - query doesn't throw an error if you use distinct() and an order_by()
     containing UnaryExpressions (or other) together [ticket:848]
 
index 48a6af030df54efb19a5ccf5073d86fe224892e5..b27530987697ae1cc13b2af09f0534b9dc7e5157 100644 (file)
@@ -501,7 +501,7 @@ class PickleType(MutableType, TypeDecorator):
         elif self.mutable:
             return self.pickler.dumps(x, self.protocol) == self.pickler.dumps(y, self.protocol)
         else:
-            return x is y
+            return x == y
 
     def is_mutable(self):
         return self.mutable