From 268834989c282963e42cc7bf27d17bcb59dca7a0 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 18 Nov 2007 16:32:47 +0000 Subject: [PATCH] - 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). --- CHANGES | 4 ++++ lib/sqlalchemy/types.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index ff0462814e..0018b83893 100644 --- 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] diff --git a/lib/sqlalchemy/types.py b/lib/sqlalchemy/types.py index 48a6af030d..b275309876 100644 --- a/lib/sqlalchemy/types.py +++ b/lib/sqlalchemy/types.py @@ -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 -- 2.47.2