summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/selectable.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2019-04-17 13:37:39 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2019-04-29 11:54:25 -0400
commit099522075088a3e1a333a2285c10a8a33b203c19 (patch)
treeb1359c9ff50d19e4787d8ead0bfe5b03ad1fb69a /lib/sqlalchemy/sql/selectable.py
parent2f55c844051d9fe8865576bd77107e94c6de16c1 (diff)
downloadsqlalchemy-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/selectable.py')
-rw-r--r--lib/sqlalchemy/sql/selectable.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/selectable.py b/lib/sqlalchemy/sql/selectable.py
index d4528f0c3..796e2b272 100644
--- a/lib/sqlalchemy/sql/selectable.py
+++ b/lib/sqlalchemy/sql/selectable.py
@@ -1994,6 +1994,9 @@ class ForUpdateArg(ClauseElement):
and other.of is self.of
)
+ def __ne__(self, other):
+ return not self.__eq__(other)
+
def __hash__(self):
return id(self)
@@ -3941,6 +3944,12 @@ class TextAsFrom(SelectBase):
self._reset_exported()
self.element = clone(self.element, **kw)
+ def get_children(self, column_collections=True, **kw):
+ if column_collections:
+ for c in self.column_args:
+ yield c
+ yield self.element
+
def _scalar_type(self):
return self.column_args[0].type