On Sat, Mar 23, 2019 at 6:26 PM Ned Batchelder <n...@nedbatchelder.com> wrote:
> On 3/23/19 1:37 PM, Gregory P. Smith wrote: > > Sure, someone is going to typo and omit the = from a := assignment in > > 3.8 but the walrus is unlikely to be used outside of an conditional or > > loop test context so this seems like a made up problem. > My original message was referring to someone writing ":" instead of "=" by mistake -- nothing to do with the walrus assignment, but rather using the same notation to assign a value to a key as they would when defining a dict. André Roberge > > Walruses aren't allowed as a top-level expression anyway: > > Python 3.8.0a2 (default, Feb 25 2019, 17:15:37) > [Clang 10.0.0 (clang-1000.10.44.4)] on darwin > Type "help", "copyright", "credits" or "license" for more information. > >>> d["answer"] := 42 > File "<stdin>", line 1 > d["answer"] := 42 > ^ > SyntaxError: invalid syntax > > > --Ned. > > _______________________________________________ > Python-ideas mailing list > Python-ideas@python.org > https://mail.python.org/mailman/listinfo/python-ideas > Code of Conduct: http://python.org/psf/codeofconduct/ >
_______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/