[issue16515] TypeError message incorrect for max() with no args

Chris Jerdonek report at bugs.python.org
Tue Nov 20 23:36:57 CET 2012


New submission from Chris Jerdonek:

The below should probably say something along the lines of "max expected 1 positional arguments" (since the foo value is an argument):

>>> max(foo=1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: max expected 1 arguments, got 0

I imagine this affects other functions, but I haven't looked into which ones.

Here is an example of another built-in function that provides a better message:

>>> sorted(foo=1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: Required argument 'iterable' (pos 1) not found

----------
components: Interpreter Core
messages: 176034
nosy: chris.jerdonek
priority: normal
severity: normal
status: open
title: TypeError message incorrect for max() with no args
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4

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


More information about the Python-bugs-list mailing list