]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Remove `__cmp__` methods (#8313)
authorNikita Sobolev <mail@sobolevn.me>
Sun, 31 Jul 2022 10:08:36 +0000 (13:08 +0300)
committerGitHub <noreply@github.com>
Sun, 31 Jul 2022 10:08:36 +0000 (12:08 +0200)
lib/sqlalchemy/cyextension/collections.pyx
lib/sqlalchemy/sql/annotation.py
lib/sqlalchemy/util/_py_collections.py

index fe2cb94ffeb6f4d8edb052fa5619d0df7e734e53..07bc85e23d4af79539ad43a3af80b1d55288a480 100644 (file)
@@ -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):
index 61849d0539935f41ff33446bbeb444adf9e1b597..95dc1d4d4953f5e4a39056bf5dafc3652b6bad64 100644 (file)
@@ -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
index d36157b105d7f033c08ecb7e81c4346b40a9978a..f8348714c57c27d462b270a74a2b8151fad8bfd2 100644 (file)
@@ -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