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 martin.panter
Recipients martin.panter, r.david.murray, serhiy.storchaka, xiang.zhang
Date 2016-08-11.23:48:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1470959301.89.0.998326348404.issue27506@psf.upfronthosting.co.za>
In-reply-to
Content
I agree it would be worth checking for a slowdown.

As well as giving the option of omitting the table argument, it would make call sites easier to read. It would avoid suggesting that the first argument is translated to the second, like maketrans().

data = data.translate(YENC_TABLE, delete=b"\r\n")

Translate() already accepts None as the first argument; this is not new:

>>> b"hello".translate(None, b"l")
b'heo'

I guess the optional group was used as a way of making the second argument optional without a specific default value.
History
Date User Action Args
2016-08-11 23:48:21martin.pantersetrecipients: + martin.panter, r.david.murray, serhiy.storchaka, xiang.zhang
2016-08-11 23:48:21martin.pantersetmessageid: <1470959301.89.0.998326348404.issue27506@psf.upfronthosting.co.za>
2016-08-11 23:48:21martin.panterlinkissue27506 messages
2016-08-11 23:48:21martin.pantercreate