[Python-Dev] PEP 572: Why not := as standard assignment operator? (original) (raw)
Martin Teichmann lkb.teichmann at gmail.com
Thu Apr 26 09:13:19 EDT 2018
- Previous message (by thread): [Python-Dev] quoted text not being marking correctly [was PEP 572 really the most effective way to solve the problems it's targeting?]
- Next message (by thread): [Python-Dev] PEP 572: Why not := as standard assignment operator?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi list,
when reading PEP 572 I actually liked it a lot - I think it's actually a cool idea. I think it's actually that cool an idea that it should be made the default way of doing an assignment, over time phasing out the good ole =.
This would have several benefits:
- people wouldn't have to worry about two different options
- different things would have a different look: assignment is :=, keyword args is =, while comparison is ==. Especially beginners would benefit from this clarity.
in this case, for sure, we should make it possible to chain :=s, for example by making it bind right-to-left, so that a := b := 3 would be a := (b := 3)
I'm sorry if somebody brought that up already, but the discussion has grown so huge that I couldn't read through it entirely.
Greetings
Martin
- Previous message (by thread): [Python-Dev] quoted text not being marking correctly [was PEP 572 really the most effective way to solve the problems it's targeting?]
- Next message (by thread): [Python-Dev] PEP 572: Why not := as standard assignment operator?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]