On Fri, 29 Apr 2022 at 04:03, Zach Victor <zmvic...@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
_______________________________________________
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/AF4AE2OLULG3VHZSN47U73AFGA73JE5A/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to