
On Fri, 29 Apr 2022 at 04:03, Zach Victor <zmvictor@gmail.com> wrote:
Where does this land with PEP 20? I think the use of pop() as you suggest lands on the implicit side of things and is not as readable: the reader has to ask, "what are we doing with the default value? Oh. Nothing. It's to delete a dict entry." However, pop() with the default value of None is practical, and practicality does beat purity.
"Implicit" does not mean "code that I dislike". The pop method is exactly what it appears to be: a way to remove something, with either an error or a default if it's not found. It then returns the thing. Ignoring a function's return value is perfectly normal. There are all manner of functions which you use all the time, and it's not a problem to have them return something you usually don't care about (like f.write() returning how much it wrote). ChrisA