[Python-ideas] Re: default as a keyword argument for dict.get and dict.pop

2022-06-08 Thread Rob Cliffe via Python-ideas
On 07/06/2022 15:28, martineznicolas41...@gmail.com wrote: I think ``` d.get(key, default=3) ``` way more readable than ``` d.get(key, 3) I completely agree. Best wishes Rob Cliffe ___ Python-ideas mailing list -- python-ideas@python.org To unsu

[Python-ideas] Re: default as a keyword argument for dict.get and dict.pop

2022-06-08 Thread Eric V. Smith via Python-ideas
On 6/7/2022 4:59 PM, Chris Angelico wrote: On Wed, 8 Jun 2022 at 00:36, wrote: Hello! Do you know if there has been discussions around why is the default argument is positional only in the dict methods get and pop? I think ``` d.get(key, default=3) ``` way more readable than ``` d.get(k

[Python-ideas] Re: default as a keyword argument for dict.get and dict.pop

2022-06-08 Thread Rob Cliffe via Python-ideas
On 08/06/2022 15:40, Eric V. Smith via Python-ideas wrote: On 6/7/2022 4:59 PM, Chris Angelico wrote: On Wed, 8 Jun 2022 at 00:36, wrote: Hello! Do you know if there has been discussions around why is the default argument is positional only in the dict methods get and pop? I think ```

[Python-ideas] Re: default as a keyword argument for dict.get and dict.pop

2022-06-08 Thread Barry
> On 8 Jun 2022, at 16:09, Rob Cliffe via Python-ideas > wrote: > >  > >> On 08/06/2022 15:40, Eric V. Smith via Python-ideas wrote: >> >>> On 6/7/2022 4:59 PM, Chris Angelico wrote: >>> On Wed, 8 Jun 2022 at 00:36, wrote: Hello! Do you know if there has been discussions ar

[Python-ideas] Re: Null wildcard in de-structuring to ignore remainder and stop iterating

2022-06-08 Thread Steve Jorgensen
My current thinking in response to that is that using islice is a decent solution except that it's not obvious. You have to jump outside of the thinking about the destructuring capability and consider what else could be used to help. Probably, first thing that _would_ come to mind from outside w