From 099522075088a3e1a333a2285c10a8a33b203c19 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 17 Apr 2019 13:37:39 -0400 Subject: 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 --- lib/sqlalchemy/sql/crud.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/sqlalchemy/sql/crud.py') 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) -- cgit v1.2.1