4 ms·
It's already used in imports as well! It was the better choice, I don't know which arguments convinced them otherwise
by TremendousJudge 7y ago
It's already used in imports as well! It was the better choice, I don't know which arguments convinced them otherwise
- kbd 7y agoI think I remember seeing something about the "as" syntax. Wish I could find what I read, IIRC some arguments convinced me that the walrus operator was an improvement.
- metalliqaz 7y agoit is discussed in the PEP https://www.python.org/dev/peps/pep-0572/#alternative-spellings https://www.python.org/dev/peps/pep-0572/#alternative-spelli...
- mixmastamyk 7y agoUnfortunately, none of the reasons listed against are very accurate.
- mixmastamyk 7y agoThe arguments were based around also supporting complex multiple assignments and being to be able to do them anywhere, not just if… and while…, list-comps, etc. Of course neither of those things have been seen in the wild or production code since. Some folks complain even the simple case above is less readable. "as" was the Pythonic choice, rather than the C/Pascalic one.