[Python-ideas] Add "default" kwarg to list.pop()

Chris Angelico rosuav at gmail.com
Wed Oct 31 15:29:43 EDT 2018


On Thu, Nov 1, 2018 at 6:25 AM Robert Vanden Eynde <robertve92 at gmail.com> wrote:
>
> Oooh, PEP463, you're reason with I switch to LBYL or write studpid try except functions so much times.
>
> Oh and also the local assignement "let/where/statement" :D
>
> x = (y+1 where y = 3.14) because x = [y+1 for y in [3.14]][0] is an overkill and ugly.
>
> Should I write a PEP even though I know it's going to be rejected because the mailing list was not really into it ?
>

There's nothing wrong with writing PEPs that have a low likelihood of
being accepted. In fact, some PEPs have specifically been written with
the purpose of rejecting them - creating a sort of FAQ document ("this
has been proposed many times, here's the arguments in favour of it,
and it's rejected because X and Y").

That said, though, you may well not need to go to that effort. 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.

ChrisA


More information about the Python-ideas mailing list