Posts: 4,220
Threads: 97
Joined: Sep 2016
python.org/msg05628.html" target="_blank" rel="noopener" class="mycode_url">https://www.mail-archive.com/python-comm...05628.html
Posts: 5,151
Threads: 396
Joined: Sep 2016
Posts: 4,220
Threads: 97
Joined: Sep 2016
Guido Wrote:But here's the catch. I'm going to try and let you all (the current committers) figure it out for yourselves.
This could get very interesting indeed.
Posts: 2,342
Threads: 62
Joined: Sep 2016
Wow. Interesting PEP as well.
Posts: 7,320
Threads: 123
Joined: Sep 2016
Thank you Guido
I have followed/looked at some of the mails reading PEP,and it's a long grinding process.
Have to spend a lot time argument back and forth.
So steeping back from this prosess is understandably.
Python will be fine as the Bus factor is no longer problem for Python.
Posts: 2,127
Threads: 11
Joined: May 2017
Jul-13-2018, 03:31 PM
(This post was last modified: Jul-13-2018, 03:32 PM by DeaD_EyE.)
I understand him.
Thank you for your time. :-)
I read the PEP 572. My first reaction was that this looks like assignment in Pascal.
But as I saw the examples, I was impressed.
if pid := os.fork():
# Parent code
else:
# Child code So with this code, the return value of os.fork() is first assigned to the name pid , then the if-statement will be executed with pid .
Doing evaluation and branching with one line code is very handy.
Posts: 12,032
Threads: 486
Joined: Sep 2016
I am looking forward to seeing what you invent next!
Python has been a gift to the world, Thank You
Posts: 3,458
Threads: 101
Joined: Sep 2016
(Jul-13-2018, 03:31 PM)DeaD_EyE Wrote: I understand him.
Thank you for your time. :-)
I read the PEP 572. My first reaction was that this looks like assignment in Pascal.
But as I saw the examples, I was impressed.
if pid := os.fork():
# Parent code
else:
# Child code So with this code, the return value of os.fork() is first assigned to the name pid , then the if-statement will be executed with pid .
Doing evaluation and branching with one line code is very handy.
I looked at the pep, and was surprised that GvR was in support of it. I was under the impression that the rule about assignment not possible in expressions was one of his original purposes in Python, as having too many things in one line can get convoluted quickly.
Posts: 2,342
Threads: 62
Joined: Sep 2016
(Jul-13-2018, 03:52 PM)nilamo Wrote: I looked at the pep, and was surprised that GvR was in support of it. I was under the impression that the rule about assignment not possible in expressions was one of his original purposes in Python, as having too many things in one line can get convoluted quickly. Yeah, I was surprised too. I think having the assignment expression use a different operator from assignment statements helps, as do examples like this
if reductor := dispatch_table.get(cls):
rv = reductor(x)
elif reductor := getattr(x, "__reduce_ex__", None):
rv = reductor(4)
elif reductor := getattr(x, "__reduce__", None):
rv = reductor()
else:
raise Error("un(deep)copyable object of type %s" % cls)
Posts: 2,127
Threads: 11
Joined: May 2017
(Jul-13-2018, 03:52 PM)nilamo Wrote: I looked at the pep, and was surprised that GvR was in support of it. I was under the impression that the rule about assignment not possible in expressions was one of his original purposes in Python, as having too many things in one line can get convoluted quickly.
Oh yes. Opinions can change. Language design is very opinionated.
My first surprise was, as he came with Type Hinting.
But if you use them at the right place, you'll benefit.
Using Type Hints everywhere doesn't look nice.
|