[issue3354] sort(reverse=None) prints misleading error message

Christoph Zwerschke report at bugs.python.org
Mon Jul 14 20:23:32 CEST 2008


Christoph Zwerschke <cito at online.de> added the comment:

The unspecific error message is thrown by the vgetargskeywords()
function, so changing this behavior would be a larger, more difficult
and general issue (similar to #1283289). We could go another path and
require an object for 'reverse' instead of an integer in the format
parameter, and then do our own checks and error messages on 'reverse'.
This looks reasonable if we want to change the behavior anyway, so that
reverse=None is accepted (cmp=None and key=None are also accepted), or
even an implicit bool(reverse) is used (but this could hide possible
errors). If we want to keep the behavior and only fix the error message,
then a more general fix of vgetargskeywords() seems to be the proper
solution.

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3354>
_______________________________________


More information about the Python-bugs-list mailing list