[issue1513] object.c do_compare comparison ordering error

2007-11-28 Thread Joseph Armbruster
New submission from Joseph Armbruster: URL: http://svn.python.org/projects/python/branches/py3k Rev: 59215 Session illustrating issue: a = None [40667 refs] cmp(a,None) Traceback (most recent call last): File stdin, line 1, in module TypeError: unorderable types: NoneType() NoneType()

[issue1513] object.c do_compare comparison ordering error

2007-11-28 Thread Christian Heimes
Christian Heimes added the comment: Guido, do we want cmp(None, None) to return a value or is the exception expected? -- assignee: - gvanrossum nosy: +gvanrossum __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1513

[issue1513] object.c do_compare comparison ordering error

2007-11-28 Thread Guido van Rossum
Guido van Rossum added the comment: This is not a bug. There's not much point is supporting cmp(None, None) when cmp(None, anything else) would still fail. cmp() should only be used when you know that the arguments belong to an orderable type. -- resolution: - rejected status: open -

[issue1513] object.c do_compare comparison ordering error

2007-11-28 Thread Joseph Armbruster
Joseph Armbruster added the comment: I had looked at the behavior in 2.5 and did not know if this would still be the case: cmp(None,'a') -1 cmp('a',None) 1 cmp(None,None) 0 __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1513

[issue1513] object.c do_compare comparison ordering error

2007-11-28 Thread Guido van Rossum
Guido van Rossum added the comment: All three of those are errors in 3.0. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1513 __ ___ Python-bugs-list mailing list Unsubscribe:

[issue1513] object.c do_compare comparison ordering error

2007-11-28 Thread Georg Brandl
Georg Brandl added the comment: Well, the cmp() docs say that cmp(x, y) is zero if ``x == y``, so at least the docs must be changed to explain the new behavior (which I can't specify). -- nosy: +georg.brandl __ Tracker [EMAIL PROTECTED]