diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2017-03-09 11:36:19 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2017-03-14 16:58:17 -0400 |
commit | 86cf3eb71c3c4d4c9f2e5cdb5059762f8f851ad9 (patch) | |
tree | fc3e74edf6e2e5a6919856617310bc2cc6968396 /lib/sqlalchemy/sql/annotation.py | |
parent | 4ece86eb41274ba059211807e23273178c3c3384 (diff) | |
download | sqlalchemy-86cf3eb71c3c4d4c9f2e5cdb5059762f8f851ad9.tar.gz |
Improve serializer behavior
Fix an issue where the Annotated system needs to have a
__reduce__ method, also see why we can't default to HIGHEST_PROTOCOL.
This latter part might not be a good idea until 1.2 for compatibility
reasons.
Change-Id: I0239e38259fc768c9e3b6c448c29161e271a969c
Fixes: #3918
Diffstat (limited to 'lib/sqlalchemy/sql/annotation.py')
-rw-r--r-- | lib/sqlalchemy/sql/annotation.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/annotation.py b/lib/sqlalchemy/sql/annotation.py index e6f6311c4..6d0eaa1d2 100644 --- a/lib/sqlalchemy/sql/annotation.py +++ b/lib/sqlalchemy/sql/annotation.py @@ -94,6 +94,9 @@ class Annotated(object): clone.__dict__.update(self.__dict__) return self.__class__(clone, self._annotations) + def __reduce__(self): + return self.__class__, (self.__element, self._annotations) + def __hash__(self): return self._hash |