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

2020-10-22 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.2, Python 
3.3, Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 rep...@bugs.python.org
http://bugs.python.org/issue16515
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 rep...@bugs.python.org
http://bugs.python.org/issue16515
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2012-11-21 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti
stage:  - needs patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16515
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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

--
keywords: +patch
stage: needs patch - patch review
Added file: http://bugs.python.org/file28064/issue16515.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16515
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 rep...@bugs.python.org
http://bugs.python.org/issue16515
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 PyArg_UnpackTuple is used to parse the *args then adding positional should 
solve the problem, however for this specific case the error would still be 
incorrect, because max also accepts more positional args.

--
Added file: http://bugs.python.org/file28065/issue16515-unpacktuple.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16515
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 rep...@bugs.python.org
http://bugs.python.org/issue16515
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2012-11-20 Thread Chris Jerdonek

Changes by Chris Jerdonek chris.jerdo...@gmail.com:


--
title: TypeError message incorrect for max() with no args - TypeError message 
incorrect for max() with one keyword arg

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16515
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com