On 21/02/2021 23:06, Terry Reedy wrote:
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+).

The way I understand it's not about print(), it's about
disambiguating multiple functions with the same name.
Example:

PS > type .\ambiguous_names.py
import random

def do_stuff():
    pass

f = do_stuff

def do_stuff(a, b):
    pass

g = do_stuff

random.choice([f, g])(42)


PS > py .\ambiguous_names.py
Traceback (most recent call last):
  File "...\ambiguous_names.py", line 13, in <module>
    random.choice([f, g])(42)
TypeError: do_stuff() missing 1 required positional argument: 'b'

The traceback gives no clue which of the two do_stuff() functions caused
the error, you have to check both implementations.

If that is a comman problem one might consider including module name and
co_firstlineno in the message, or at least adding the relevant
do_stuff() function to the exception's args.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/E7OUHLWXP3NHEM3UZOBWP5AQRSFL5RDO/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to