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

Grant Edwards grant.b.edwards at gmail.com
Tue Dec 15 15:26:23 EST 2020


On 2020-12-15, Mark Polesky via Python-list <python-list at python.org> wrote:

> I see. Perhaps counterintuitive,

I guess that depends on what programming language you normally think
in. Python's handling of function parameters is exactly what I
expected, because all of the previous languages I used did the same
thing.

Purely out of curiosity, what language had you been using that behaved
otherwise?



More information about the Python-list mailing list