[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

[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 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 ```

[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

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

2022-06-07 Thread Chris Angelico
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(key, 3) > ``` > >

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

2022-06-07 Thread Steven D'Aprano
On Tue, Jun 07, 2022 at 02:28:51PM -, martineznicolas41...@gmail.com wrote: > Do you know if there has been discussions around why is the default > argument is positional only in the dict methods get and pop? Its probably just left over from earlier versions of Python when builtin