From: Paul Rubin <no.email@nospam.invalid>
Subject: Re: [Off-Topic] Python gets :=
Date: Sat, 21 Jul 2018 00:50:01 -0700
Date: 2018-07-21T00:50:01-07:00 [thread overview]
Message-ID: <87pnzhf2om.fsf@nightsong.com> (raw)
In-Reply-To: piuhd9$1sc1$1@gioia.aioe.org
"Nasser M. Abbasi" <nma@12000.org> 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.
next prev parent reply other threads:[~2018-07-21 7:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-20 21:56 [Off-Topic] Python gets := Alejandro R. Mosteo
2018-07-21 5:47 ` Nasser M. Abbasi
2018-07-21 7:50 ` Paul Rubin [this message]
2018-07-21 8:37 ` G.B.
2018-07-21 10:31 ` Chris M Moore
2018-07-21 15:03 ` Rene
2018-07-21 16:34 ` Paul Rubin
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox