[Python-Dev] Re: Inadequate error reporting during function call setup stage

2021年2月21日 14:09:24 -0800

On 2/21/2021 12:04 PM, Paul Sokolovsky wrote:
Traceback (most recent call last):
 File "pseudoc_tool.py", line 91, in <module>
 first_class_function_value(func, **pass_params)
TypeError: print() got an unexpected keyword argument 'noann'
This is not typical behavior in current Python (3.8+).
def f(): pass
def g(): f(a=0)
g()
for instance, results in
Traceback (most recent call last):
 File "F:\Python\a\tem3.py", line 3, in <module>
 g()
 File "F:\Python\a\tem3.py", line 2, in g
 def g(): f(a=0)
TypeError: f() got an unexpected keyword argument 'a'
def f(): print(b=4)
def g(): f()
g()
gives me
Traceback (most recent call last):
 File "F:\Python\a\tem3.py", line 3, in <module>
 g()
 File "F:\Python\a\tem3.py", line 2, in g
 def g(): f()
 File "F:\Python\a\tem3.py", line 1, in f
 def f(): print(b=4)
TypeError: 'b' is an invalid keyword argument for print()
Can you create a minimal complete verifiable example and post it on bugs.python.org. This is where bug reports belong, not on pydev and python-ideas.
I now implemented that too, and now everything makes sense:
Traceback (most recent call last):
 File "pseudoc_tool.py", line 91, in <module>
 File "../xforms.py", line 25, in print
TypeError: unexpected keyword argument 'noann'
Since you have a fix in your repository, perhaps you can include a PR against cpython master branch.
--
Terry Jan Reedy
_______________________________________________
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/QK2FWYBY3SJ2KPMJ37HCEF7QM5DDN2MT/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to