[issue29951] PyArg_ParseTupleAndKeywords exception messages containing "function"

2017-06-09 Thread STINNER Victor

STINNER Victor added the comment:


New changeset f9f1ccace395a8f65b60dc12567a237b4002fd18 by Victor Stinner 
(Serhiy Storchaka) in branch 'master':
Fix regression in error message introduced in bpo-29951. (#2028)
https://github.com/python/cpython/commit/f9f1ccace395a8f65b60dc12567a237b4002fd18


--
nosy: +haypo

___
Python tracker 

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



[issue29951] PyArg_ParseTupleAndKeywords exception messages containing "function"

2017-06-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +2094

___
Python tracker 

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



[issue29951] PyArg_ParseTupleAndKeywords exception messages containing "function"

2017-04-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your contribution Michael. Since most builtin and extension 
functions and methods now use Argument Clinic and provide a function name, this 
should be a great enhancement.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue29951] PyArg_ParseTupleAndKeywords exception messages containing "function"

2017-04-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 64c8f705c0121a4b45ca2c3bc7b47b282e9efcd8 by Serhiy Storchaka 
(Michael Seifert) in branch 'master':
bpo-29951: Include function name for some error messages in `PyArg_ParseTuple*` 
(#916)
https://github.com/python/cpython/commit/64c8f705c0121a4b45ca2c3bc7b47b282e9efcd8


--

___
Python tracker 

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



[issue29951] PyArg_ParseTupleAndKeywords exception messages containing "function"

2017-03-31 Thread R. David Murray

R. David Murray added the comment:

If you want to be completely unambiguous, you could say "keyword argument 
names".  "keyword argument" appears to mean different things in different 
contexts; sometimes it means the name and the value together, sometimes one or 
the other.  Usually which one it is is clear from context, but it seems in this 
case it is not clear.

--

___
Python tracker 

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



[issue29951] PyArg_ParseTupleAndKeywords exception messages containing "function"

2017-03-31 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I agree. PyArg_ValidateKeywordArguments() fooled me. Now I see that it would be 
better to change only PyArg_ValidateKeywordArguments().

--

___
Python tracker 

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



[issue29951] PyArg_ParseTupleAndKeywords exception messages containing "function"

2017-03-31 Thread Martin Panter

Martin Panter added the comment:

In this test, “keyword arguments” is definitely wrong:

 >>> f(**{1:2})
-TypeError: f() keywords must be strings
+TypeError: f() keyword arguments must be strings

To me, a keyword argument is a _value_ passed in using the f(name=. . .) 
syntax, and the keyword is the name that identifies it (usually becomes a 
parameter name in the function implementation). So I think the original was 
better. But if you think the original can be confusing, “keyword names” would 
also work.

The other messages look okay to me.

--

___
Python tracker 

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



[issue29951] PyArg_ParseTupleAndKeywords exception messages containing "function"

2017-03-31 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> But are you sure about the "keywords must be strings" -> "keyword arguments 
> must be strings" change? I always thought the key is the "keyword" and the 
> value the "(keyword) argument".

Now, after you have made change, I have doubts. Yes, it looks ambiguous. Maybe 
"keyword names"? Martin, David, what are your thoughts?

--
nosy: +r.david.murray

___
Python tracker 

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



[issue29951] PyArg_ParseTupleAndKeywords exception messages containing "function"

2017-03-31 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Martin, could you please take a look? Does the wording of error messages look 
good English? Do you have to suggest some enhancements?

--
nosy: +martin.panter

___
Python tracker 

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



[issue29951] PyArg_ParseTupleAndKeywords exception messages containing "function"

2017-03-31 Thread Michael Seifert

Michael Seifert added the comment:

Thank you for the suggestions, I added them to the PR. If you want 

But are you sure about the "keywords must be strings" -> "keyword arguments 
must be strings" change? I always thought the key is the "keyword" and the 
value the "(keyword) argument".

--

___
Python tracker 

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



[issue29951] PyArg_ParseTupleAndKeywords exception messages containing "function"

2017-03-31 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

And while we are here, please change "keywords must be strings" to "keyword 
arguments must be strings" as in PyArg_ValidateKeywordArguments(). And maybe 
make all TypeError messages starting from a lower letter for uniformity.

--

___
Python tracker 

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



[issue29951] PyArg_ParseTupleAndKeywords exception messages containing "function"

2017-03-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM in general. I was going to make similar changes.

While we a here, maybe add the function name to other TypeError messages 
specific to the function? "Required argument '%U' (pos %d) not found" and 
"Argument given by name ('%U') and position (%d)", but not to "keywords must be 
strings".

Classified this as an enhancement.

--
components: +Interpreter Core
nosy: +serhiy.storchaka
stage:  -> patch review
type: behavior -> enhancement
versions:  -Python 3.5, Python 3.6

___
Python tracker 

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



[issue29951] PyArg_ParseTupleAndKeywords exception messages containing "function"

2017-03-30 Thread Michael Seifert

Changes by Michael Seifert :


--
pull_requests: +816

___
Python tracker 

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



[issue29951] PyArg_ParseTupleAndKeywords exception messages containing "function"

2017-03-30 Thread Michael Seifert

New submission from Michael Seifert:

Some exceptions thrown by `PyArg_ParseTupleAndKeywords` refer to "function" or 
"this function" even when a function name was specified.

For example:

>>> import bisect
>>> bisect.bisect_right([1,2,3,4], 2, low=10)
TypeError: 'low' is an invalid keyword argument for this function

Wouldn't it be better to replace the "this function" part (if given) with the 
actual function name?

--
messages: 290885
nosy: MSeifert
priority: normal
severity: normal
status: open
title: PyArg_ParseTupleAndKeywords exception messages containing "function"
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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