This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Jim.Jewett
Recipients Jim.Jewett, docs@python
Date 2016-11-04.17:02:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
One commonly needed string transformation is stripping out certain characters (or only keeping certain characters).  This is common enough that it might be worth a dedicated method, except, that, as Stephen J. Turnbull wrote in

So really translate with defaultdict is a specialized loop that
marries an algorithmic body (which could do things like look up the
original script or other character properties to decide on the
replacement for the generic case) with a (usually "small") table of
exceptions.  That seems like inspired design to me.

Alas, while inspired, it isn't obvious to someone who isn't yet used to the power of python custom classes.

The documentation (such as ) should include such an example.

One possible example would be a defaultdict that says to discard any characters except lower case ASCII lettersI.
Date User Action Args
2016-11-04 17:02:34Jim.Jewettsetrecipients: + Jim.Jewett, docs@python
2016-11-04 17:02:34Jim.Jewettsetmessageid: <>
2016-11-04 17:02:34Jim.Jewettlinkissue28612 messages
2016-11-04 17:02:34Jim.Jewettcreate