Author rhettinger
Recipients larry, rhettinger
Date 2019-06-08.18:48:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1560019685.35.0.640301237908.issue37206@roundup.psfhosted.org>
In-reply-to
Content
help(dict.pop) was correct in 3.7:

    pop(...)
        D.pop(k[,d]) -> v

and incorrect for 3.8:

     pop(self, key, default=None, /)

This happened in:
     https://github.com/python/cpython/commit/9e4f2f3a6b8ee995c365e86d976937c141d867f8
     https://github.com/python/cpython/pull/12792

We've long known that the Argument Clinic was not applicable to all functions and methods, including this one in particular.  The issue is that the one argument form does not set the default to None; rather, it triggers a KeyError when the key is missing.  In other words, there is an important and long-standing semantic difference between d.pop(k) and d.pop(k,None).

When reverting this change, please add a note about why the ArgumentClinic is not being applied to this function until its capabilities have been built-out to handle functions that have different behaviors depending on the number of arguments.

Also, we should review other recent applications of the ArgumentClinic to make sure they didn't make the same mistake.
History
Date User Action Args
2019-06-08 18:48:05rhettingersetrecipients: + rhettinger, larry
2019-06-08 18:48:05rhettingersetmessageid: <1560019685.35.0.640301237908.issue37206@roundup.psfhosted.org>
2019-06-08 18:48:05rhettingerlinkissue37206 messages
2019-06-08 18:48:05rhettingercreate