diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2019-04-17 13:37:39 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2019-04-29 11:54:25 -0400 |
commit | 099522075088a3e1a333a2285c10a8a33b203c19 (patch) | |
tree | b1359c9ff50d19e4787d8ead0bfe5b03ad1fb69a /lib/sqlalchemy/sql/crud.py | |
parent | 2f55c844051d9fe8865576bd77107e94c6de16c1 (diff) | |
download | sqlalchemy-099522075088a3e1a333a2285c10a8a33b203c19.tar.gz |
Reimplement .compare() in terms of a visitor
Reworked the :meth:`.ClauseElement.compare` methods in terms of a new
visitor-based approach, and additionally added test coverage ensuring that
all :class:`.ClauseElement` subclasses can be accurately compared
against each other in terms of structure. Structural comparison
capability is used to a small degree within the ORM currently, however
it also may form the basis for new caching features.
Fixes: #4336
Change-Id: I581b667d8e1642a6c27165cc9f4aded1c66effc6
Diffstat (limited to 'lib/sqlalchemy/sql/crud.py')
-rw-r--r-- | lib/sqlalchemy/sql/crud.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/crud.py b/lib/sqlalchemy/sql/crud.py index 6c9b8ee5b..552f61b4a 100644 --- a/lib/sqlalchemy/sql/crud.py +++ b/lib/sqlalchemy/sql/crud.py @@ -482,6 +482,12 @@ class _multiparam_column(elements.ColumnElement): self.default = original.default self.type = original.type + def compare(self, other, **kw): + raise NotImplementedError() + + def _copy_internals(self, other, **kw): + raise NotImplementedError() + def __eq__(self, other): return ( isinstance(other, _multiparam_column) |