[Python-ideas] Re: PEP 671 (late-bound arg defaults), next round of discussion!

2021-11-30 Thread Steven D'Aprano
On Wed, Dec 01, 2021 at 07:47:49AM -, Jeremiah Vivian wrote: > > 2) Independently: Is the syntactic distinction between "=" and "=>" a > > cognitive burden? > No, it isn't much of a cognitive burden. You say that now, but if you read function definitions that looked like this: def

[Python-ideas] Re: PEP 671 (late-bound arg defaults), next round of discussion!

2021-11-30 Thread Jeremiah Vivian
Answering questions: > 1) If this feature existed in Python 3.11 exactly as described, would > you use it? I would definitely use it. > 2) Independently: Is the syntactic distinction between "=" and "=>" a > cognitive burden? No, it isn't much of a cognitive burden. > 3) If "yes" to question 1,

[Python-ideas] Re: PEP 671 (late-bound arg defaults), next round of discussion!

2021-11-30 Thread Abdulla Al Kathiri
> On 1 Dec 2021, at 10:16 AM, Chris Angelico wrote: > > I've just updated PEP 671 https://www.python.org/dev/peps/pep-0671/ > with some additional information about the reference implementation, > and some clarifications elsewhere. > > *PEP 671: Syntax for late-bound function argument

[Python-ideas] Re: Enhancing iterator objects with map, filter, reduce methods

2021-11-30 Thread Chris Angelico
On Wed, Dec 1, 2021 at 6:14 PM Abdulla Al Kathiri wrote: > > Thanks for the clarification. Yeah I agree it will look ugly if we use it not > as a first argument many times in a row but what if there is one or two > functions in the middle that they are not playing along and don’t have >

[Python-ideas] Re: Enhancing iterator objects with map, filter, reduce methods

2021-11-30 Thread Abdulla Al Kathiri
Thanks for the clarification. Yeah I agree it will look ugly if we use it not as a first argument many times in a row but what if there is one or two functions in the middle that they are not playing along and don’t have teamwork ethics, meaning they put the parameter we are interested in as a

[Python-ideas] PEP 671 (late-bound arg defaults), next round of discussion!

2021-11-30 Thread Chris Angelico
I've just updated PEP 671 https://www.python.org/dev/peps/pep-0671/ with some additional information about the reference implementation, and some clarifications elsewhere. *PEP 671: Syntax for late-bound function argument defaults* Questions, for you all: 1) If this feature existed in Python

[Python-ideas] Re: Enhancing iterator objects with map, filter, reduce methods

2021-11-30 Thread Christopher Barker
On Tue, Nov 30, 2021 at 2:17 PM Chris Angelico wrote: > > I don’t like the fact this is used only as a first parameter. What if > you want the preceding output to go as a second parameter? > > > in real world situations, > that's easily the most common form needed. > Exactly -- the goal

[Python-ideas] Re: Enhancing iterator objects with map, filter, reduce methods

2021-11-30 Thread Chris Angelico
On Wed, Dec 1, 2021 at 9:09 AM Abdulla Al Kathiri wrote: > > How about using the typing return arrow -> to indicate the return of the > preceding goes as a first parameter in the function: > 1 -> add(2) That's a possibility. The same arrow then means "this function produces that value" in a

[Python-ideas] Re: Enhancing iterator objects with map, filter, reduce methods

2021-11-30 Thread Abdulla Al Kathiri
How about using the typing return arrow -> to indicate the return of the preceding goes as a first parameter in the function: 1 -> add(2) I don’t like the fact this is used only as a first parameter. What if you want the preceding output to go as a second parameter? Abdulla Sent from my