[issue16515] TypeError message incorrect for max() with one keyword arg

2012-11-20 Thread Chris Jerdonek
Changes by Chris Jerdonek : -- title: TypeError message incorrect for max() with no args -> TypeError message incorrect for max() with one keyword arg ___ Python tracker ___ ___

[issue16515] TypeError message incorrect for max() with one keyword arg

2012-11-21 Thread Mark Dickinson
Mark Dickinson added the comment: It would be nice to change 'arguments' to 'argument' in this case, too. :-) -- nosy: +mark.dickinson ___ Python tracker ___

[issue16515] TypeError message incorrect for max() with one keyword arg

2012-11-21 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti stage: -> needs patch ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue16515] TypeError message incorrect for max() with one keyword arg

2012-11-21 Thread Ezio Melotti
Ezio Melotti added the comment: Attached an initial patch: >>> max() TypeError: max() requires at least a positional argument >>> max(foo=3) TypeError: max() requires at least a positional argument >>> max(3, foo=3) TypeError: max() got an unexpected keyword argument >>> max(3, 4) 4 -- k

[issue16515] TypeError message incorrect for max() with one keyword arg

2012-11-21 Thread Mark Dickinson
Mark Dickinson added the comment: Would it make sense to adjust the error messages in PyArg_UnpackTuple instead? I suspect there are quite a lot of functions using it. -- ___ Python tracker __

[issue16515] TypeError message incorrect for max() with one keyword arg

2012-11-21 Thread Ezio Melotti
Ezio Melotti added the comment: PyArg_UnpackTuple could be fixed to say "positional argument" (see attached patch (maybe this should be a separate issue)). The error returned by max() is wrong because PyArg_UnpackTuple is used on the *args alone first, and it has no knowledge of the kwargs. If

[issue16515] TypeError message incorrect for max() with one keyword arg

2012-11-21 Thread Mark Dickinson
Mark Dickinson added the comment: Yes, true: max is probably still going to have to be a special case, thanks to its schizophrenic signature. (max([1, 2, 3]) versus max(1, 2, 3)). -- ___ Python tracker _

[issue16515] TypeError message incorrect for max() with one keyword arg

2012-11-23 Thread Ezio Melotti
Ezio Melotti added the comment: I created #16543 for PyArg_UnpackTuple. Once that is fixed we can continue with this. -- dependencies: +Use "positional arguments" in PyArg_UnpackTuple ___ Python tracker ___