diff options
Diffstat (limited to 'lib/sqlalchemy/ext/asyncio/base.py')
-rw-r--r-- | lib/sqlalchemy/ext/asyncio/base.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/sqlalchemy/ext/asyncio/base.py b/lib/sqlalchemy/ext/asyncio/base.py index 051f9e21a..fa8c5006e 100644 --- a/lib/sqlalchemy/ext/asyncio/base.py +++ b/lib/sqlalchemy/ext/asyncio/base.py @@ -23,3 +23,20 @@ class StartableContext(abc.ABC): "%s context has not been started and object has not been awaited." % (self.__class__.__name__) ) + + +class ProxyComparable: + def __hash__(self): + return id(self) + + def __eq__(self, other): + return ( + isinstance(other, self.__class__) + and self._proxied == other._proxied + ) + + def __ne__(self, other): + return ( + not isinstance(other, self.__class__) + or self._proxied != other._proxied + ) |