3 ms·
I had to look this one up. PEP 572 [1] introduces "the walrus operator". Your claim that it "stunk badly" made me think that perhaps it was proposed and rejec
by wyldfire 8y ago
I had to look this one up. PEP 572 [1] introduces "the walrus operator". Your claim that it "stunk badly" made me think that perhaps it was proposed and rejected, however it's listed as 'accepted' and among the new features from CPython 3.8. I suppose if you're the BDFL you can get your PEPs approved ;)
AFAICT it allows for optional binding. I suppose it might seem like 'cargo cult' because Rust and Swift have 'if let'?
[1] https://www.python.org/dev/peps/pep-0572/ https://www.python.org/dev/peps/pep-0572/
- basic6 8y agoIt was accepted but that PEP caused the whole kerfuffle correct? It became fashionable to have a strong opinion on assignment vs equality.