dict.get(key, default) evaluates default even if key exists

Grant Edwards grant.b.edwards at gmail.com
Wed Dec 16 14:31:23 EST 2020


On 2020-12-16, Dennis Lee Bieber <wlfraed at ix.netcom.com> wrote:
> On Tue, 15 Dec 2020 20:08:53 +0000 (UTC), Mark Polesky via Python-list
><python-list at python.org> declaimed the following:
>
>>behavior, and I can't remember any programming language in which it's
>>different.
>
> https://en.wikipedia.org/wiki/Evaluation_strategy#Call_by_name 

Most of us only run across call-by-name when using macro processors
(cpp, m4, TeX, various assemblers). I vaguely recall some other old
language I ran across in a survey course when in college that used it.
IIRC it was Algol. Somebody else already mentioned Haskel.

--
Grant









More information about the Python-list mailing list