https://github.com/python/cpython/commit/4877e33708b3723d4b4069ca5c5f090d0b8dcec6
commit: 4877e33708b3723d4b4069ca5c5f090d0b8dcec6
branch: main
author: Kirill Podoprigora <kirill.ba...@mail.ru>
committer: Eclips4 <kirill.ba...@mail.ru>
date: 2024-10-30T00:47:26+02:00
summary:

gh-126146: Remove ``__cmp__`` method from tests (#126147)

Remove ``__cmp__`` method from the tests because it was removed in 3.0 version.

files:
M Lib/test/test_descr.py
M Lib/test/test_richcmp.py

diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
index c8e3a4be26b506..aa801b9c4f7ad9 100644
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -3239,8 +3239,6 @@ class classic:
             class C(base):
                 def __init__(self, value):
                     self.value = int(value)
-                def __cmp__(self_, other):
-                    self.fail("shouldn't call __cmp__")
                 def __eq__(self, other):
                     if isinstance(other, C):
                         return self.value == other.value
diff --git a/Lib/test/test_richcmp.py b/Lib/test/test_richcmp.py
index 5f449cdc05c6ba..b967c7623c57b0 100644
--- a/Lib/test/test_richcmp.py
+++ b/Lib/test/test_richcmp.py
@@ -28,9 +28,6 @@ def __gt__(self, other):
     def __ge__(self, other):
         return self.x >= other
 
-    def __cmp__(self, other):
-        raise support.TestFailed("Number.__cmp__() should not be called")
-
     def __repr__(self):
         return "Number(%r)" % (self.x, )
 
@@ -53,9 +50,6 @@ def __setitem__(self, i, v):
     def __bool__(self):
         raise TypeError("Vectors cannot be used in Boolean contexts")
 
-    def __cmp__(self, other):
-        raise support.TestFailed("Vector.__cmp__() should not be called")
-
     def __repr__(self):
         return "Vector(%r)" % (self.data, )
 

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-le...@python.org
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: arch...@mail-archive.com

Reply via email to