On Wed, Oct 31, 2018 at 12:31 PM Chris Angelico <ros...@gmail.com> wrote:
> What is being asked for here (if I'm not misreading) is a relatively simple > enhancement to a method on a built-in type (or a small handful of > types). If that garners reasonable support, the next step wouldn't be > a PEP, it'd just go straight to a tracker issue and a pull request. > > For myself, I'm +0 on adding default=. It'd be a minor convenience on > a very small number of cases. But it wouldn't bother me at all so it > wouldn't be a problem if it were to land. > If the consensus is to add a default keyword parameter for the rest of the get/pop methods on built-in types, it'd be reasonable to write an addendum to PEP 463 that mentions what is being established as the Pythonic interface: When a method can raise IndexError or KeyError, the method should provide an optional default which suppresses the error.
_______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/