]> granicus.if.org Git - python/commitdiff
Issue #8627: remove out-of-date warning about overriding __cmp__
authorMark Dickinson <dickinsm@gmail.com>
Sat, 5 Jun 2010 11:52:24 +0000 (11:52 +0000)
committerMark Dickinson <dickinsm@gmail.com>
Sat, 5 Jun 2010 11:52:24 +0000 (11:52 +0000)
Lib/test/test_descr.py
Misc/NEWS
Objects/typeobject.c

index 2fdd62fc4fded590bcc7e3769e51bd4b2d349386..7e9b62b838da5dfddb6dea3ad72c39dd499b7dfa 100644 (file)
@@ -4621,7 +4621,6 @@ def test_main():
         deprecations += [
             ("classic (int|long) division", DeprecationWarning),
             ("coerce.. not supported", DeprecationWarning),
-            ("Overriding __cmp__ ", DeprecationWarning),
             (".+__(get|set|del)slice__ has been removed", DeprecationWarning)]
     with test_support.check_warnings(*deprecations):
         # Run all local test cases, with PTypesLongInitTest first.
index f82f048bc47ce4ae0b5ad362856c291303d768d8..3378c5d44df8f05183c73451022c25c64d949b22 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,6 +12,9 @@ What's New in Python 2.7 Release Candidate 1?
 Core and Builtins
 -----------------
 
+- Issue #8627: Remove bogus "Overriding __cmp__ blocks inheritance of
+  __hash__ in 3.x" warning.
+
 - Issue #8748: Fix two issues with comparisons between complex and integer
   objects.  (1) The comparison could incorrectly return True in some cases
   (2**53+1 == complex(2**53) == 2**53), breaking transivity of equality.
index 605d8a010790acd64739028e440629640956fb4d..5767b87dfe13f88e97890b01b518afd39083011a 100644 (file)
@@ -3723,7 +3723,6 @@ overrides_name(PyTypeObject *type, char *name)
 }
 
 #define OVERRIDES_HASH(x)       overrides_name(x, "__hash__")
-#define OVERRIDES_CMP(x)        overrides_name(x, "__cmp__")
 #define OVERRIDES_EQ(x)         overrides_name(x, "__eq__")
 
 static void
@@ -3869,12 +3868,6 @@ inherit_slots(PyTypeObject *type, PyTypeObject *base)
                 if (base->tp_hash &&
                                 (base->tp_hash != PyObject_HashNotImplemented) &&
                                 !OVERRIDES_HASH(type)) {
-                    if (OVERRIDES_CMP(type)) {
-                        PyErr_WarnPy3k("Overriding "
-                          "__cmp__ blocks inheritance "
-                          "of __hash__ in 3.x",
-                          1);
-                    }
                     if (OVERRIDES_EQ(type)) {
                         PyErr_WarnPy3k("Overriding "
                           "__eq__ blocks inheritance "