From: <pj...@us...> - 2009-04-05 22:13:46
|
Revision: 6169 http://jython.svn.sourceforge.net/jython/?rev=6169&view=rev Author: pjenvey Date: 2009-04-05 22:13:33 +0000 (Sun, 05 Apr 2009) Log Message: ----------- fix dictproxy equality checks Modified Paths: -------------- trunk/jython/Lib/test/test_dictproxy_jy.py trunk/jython/src/org/python/core/PyDictProxy.java Modified: trunk/jython/Lib/test/test_dictproxy_jy.py =================================================================== --- trunk/jython/Lib/test/test_dictproxy_jy.py 2009-04-05 19:27:20 UTC (rev 6168) +++ trunk/jython/Lib/test/test_dictproxy_jy.py 2009-04-05 22:13:33 UTC (rev 6169) @@ -31,8 +31,18 @@ self.assert_(proxy is not copy) self.assertEqual(len(proxy), len(copy)) + def test_dictproxy_equality(self): + self.assertEqual(type.__dict__, type.__dict__) + self.assertEqual(type.__dict__, type.__dict__.copy()) + self.assertEqual(type.__dict__, dict(type.__dict__)) + self.assertEqual(cmp(type.__dict__, type.__dict__), 0) + self.assertEqual(cmp(type.__dict__, type.__dict__.copy()), 0) + self.assertEqual(cmp(type.__dict__, dict(type.__dict__)), 0) + + def test_main(): test_support.run_unittest(DictproxyTestCase) + if __name__ == '__main__': test_main() Modified: trunk/jython/src/org/python/core/PyDictProxy.java =================================================================== --- trunk/jython/src/org/python/core/PyDictProxy.java 2009-04-05 19:27:20 UTC (rev 6168) +++ trunk/jython/src/org/python/core/PyDictProxy.java 2009-04-05 22:13:33 UTC (rev 6169) @@ -93,7 +93,7 @@ @ExposedMethod(type = MethodType.CMP) public int dictproxy___cmp__(PyObject other) { - return dict.__cmp__(other); + return dict._cmp(other); } @ExposedMethod(type = MethodType.BINARY) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |