[docs] [issue33235] Better help text for dict.setdefault

Éric Araujo report at bugs.python.org
Fri Apr 6 12:31:54 EDT 2018


Éric Araujo <merwok at netwok.org> added the comment:

The two lines are equivalent!

`d.setdefault(key, default)` does return the same thing as `d.get(key, default)`, and then sets `d[key] = default` if the get method went into the “key was not found, let’s return default” branch.

----------
nosy: +eric.araujo

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33235>
_______________________________________


More information about the docs mailing list