[Python-Dev] AC Derby and accepting None for optional positional arguments

Ryan Smith-Roberts rmsr at lab.net
Thu Jan 16 04:57:46 CET 2014


One of the downsides of converting positional-only functions to Argument
Clinic is that it can result in misleading docstring signatures. Example:

socket.getservbyname(servicename[, protocolname])
->
socket.getservbyname(servicename, protocolname=None)

The problem with the new signature is that it indicates passing None for
protocolname is the same as omitting it (the other, much larger problem is
that it falsely indicates keyword compatibility, but that's a separate
indoor elephant).

My question:

Is it OK to change a longstanding function to treat None like an absent
parameter, where previously it was an error? (This also entails a docs
update and maybe a changelog entry)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20140115/82c11a67/attachment.html>


More information about the Python-Dev mailing list