diff options
author | Nikita Sobolev <mail@sobolevn.me> | 2022-07-31 13:08:36 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-31 12:08:36 +0200 |
commit | 1657312ba77cf2a8751aed195b4d246afb28b64e (patch) | |
tree | 8bd79e504b86f691a78e71a78b6140f9ee790b2d | |
parent | f8c4dba4e9f130c18ce00597c036bc26ae7abf90 (diff) | |
download | sqlalchemy-1657312ba77cf2a8751aed195b4d246afb28b64e.tar.gz |
Remove `__cmp__` methods (#8313)
-rw-r--r-- | lib/sqlalchemy/cyextension/collections.pyx | 3 | ||||
-rw-r--r-- | lib/sqlalchemy/sql/annotation.py | 2 | ||||
-rw-r--r-- | lib/sqlalchemy/util/_py_collections.py | 3 |
3 files changed, 1 insertions, 7 deletions
diff --git a/lib/sqlalchemy/cyextension/collections.pyx b/lib/sqlalchemy/cyextension/collections.pyx index fe2cb94ff..07bc85e23 100644 --- a/lib/sqlalchemy/cyextension/collections.pyx +++ b/lib/sqlalchemy/cyextension/collections.pyx @@ -213,9 +213,6 @@ cdef class IdentitySet: def clear(self): self._members.clear() - def __cmp__(self, other): - raise TypeError("cannot compare sets using cmp()") - def __eq__(self, other): cdef IdentitySet other_ if isinstance(other, IdentitySet): diff --git a/lib/sqlalchemy/sql/annotation.py b/lib/sqlalchemy/sql/annotation.py index 61849d053..95dc1d4d4 100644 --- a/lib/sqlalchemy/sql/annotation.py +++ b/lib/sqlalchemy/sql/annotation.py @@ -257,7 +257,7 @@ class Annotated(SupportsAnnotations): """clones a SupportsAnnotations and applies an 'annotations' dictionary. Unlike regular clones, this clone also mimics __hash__() and - __cmp__() of the original element so that it takes its place + __eq__() of the original element so that it takes its place in hashed collections. A reference to the original element is maintained, for the important diff --git a/lib/sqlalchemy/util/_py_collections.py b/lib/sqlalchemy/util/_py_collections.py index d36157b10..f8348714c 100644 --- a/lib/sqlalchemy/util/_py_collections.py +++ b/lib/sqlalchemy/util/_py_collections.py @@ -296,9 +296,6 @@ class IdentitySet: def clear(self) -> None: self._members.clear() - def __cmp__(self, other: Any) -> NoReturn: - raise TypeError("cannot compare sets using cmp()") - def __eq__(self, other: Any) -> bool: if isinstance(other, IdentitySet): return self._members == other._members |