On Tue., Feb. 9, 2021, 12:20 Serhiy Storchaka, <storchaka@gmail.com> wrote:
09.02.21 12:22, Erlend Aasland пише:
> What's the recommended approach with issues like https://bugs.python.org/issue43094? Change the docs or the implementation? I did a quick search on bpo, but could not find similar past issues.

If the documentation and the C implemented function contradict about
parameter name, we are free to treat the parameter as positional-only.
User cannot pass the argument as keyword because the documented name
does not work, and the real name is not exposed to the user.

I agree with Serhiy's logic.

-Brett


In this case, there are two similar functions, create_function() and
create_aggregate(). Both are documented as having parameter
"num_params", but real names are different: "narg" and "n_arg". It would
be confusing to have different spelling of the same parameter in similar
functions. I am sure that it would be difficult to remember how is it
spelled in every case. Also, in Python terminology, the semantic of this
name is the number of parameters, not the number of argument.

So I think that in this particular case the chance of breaking some code
is insignificant, but possible long-term harm of exposing bad parameter
names may be significant.
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-leave@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/JE2E5RJZQPMXHTWIU3NA74YDMEZHGYUK/
Code of Conduct: http://python.org/psf/codeofconduct/