New submission from Chris Jerdonek: The code below in bytes_decode() is unnecessary:
if (encoding == NULL) encoding = PyUnicode_GetDefaultEncoding(); (from http://hg.python.org/cpython/file/e9af9b1ca67e/Objects/bytesobject.c#l2230 ) because PyUnicode_FromEncodedObject() already handles the case of NULL encoding (inside normalize_encoding() called by PyUnicode_Decode()): http://hg.python.org/cpython/file/e9af9b1ca67e/Objects/unicodeobject.c#l2811 ---------- components: Interpreter Core keywords: easy messages: 175811 nosy: chris.jerdonek, haypo priority: normal severity: normal status: open title: bytes_decode() unnecessarily examines encoding type: enhancement versions: Python 3.4 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue16495> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com