From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.ada Subject: Re: [Off-Topic] Python gets := Date: Sat, 21 Jul 2018 00:50:01 -0700 Organization: A noiseless patient Spider Message-ID: <87pnzhf2om.fsf@nightsong.com> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="c5b974d967a3f385bc3bbdf02d700ee6"; logging-data="23138"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19WcHDzoxkwWf4nCKCVOmXC" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) Cancel-Lock: sha1:YXQlt1FSozclU2m0lBf+kHWesI4= sha1:zH1ZWZWS/Le6LriDh/yRjVJm4/Y= Xref: reader02.eternal-september.org comp.lang.ada:53929 Date: 2018-07-21T00:50:01-07:00 List-Id: "Nasser M. Abbasi" writes: > Was not a variable assignment something already known in those dark > ages back in 1989 when Python was designed? Python has had assignment statements like "a = 5" from the beginning. The thing they just added was assignments inside expressions, like in C: if (m := re.match('foo(.*)bar', thing)): blecch(m) i.e. if the regexp matches, save the match data in the variable m and pass it to blecch on the next line. I don't think Ada has that feature. It's not something to fight wars about, but I do find it useful sometimes in both C and Python.