[docs] [issue28612] str.translate needs a mapping example

Raymond Hettinger report at bugs.python.org
Fri Dec 30 00:23:24 EST 2016


Raymond Hettinger added the comment:

I like the idea of adding a mapping example but don't want to encourage use of defaultdict in contexts like this one.  A defaultdict usefully specifies a default but has the unpleasant side-effect of altering the dictionary (adding new keys) during the look-up phase.  This has bitten a lot of people (including famous ones like Peter Norvig).

----------
nosy: +rhettinger

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28612>
_______________________________________


More information about the docs mailing list