STINNER Victor <victor.stin...@haypocalc.com> added the comment: > *.encode('rot_13') ==> CodecLookupError
I like the idea of raising a lookup error on .encode/.decode if the codec is not a classic text codec (like ASCII or UTF-8). > *.transform('ascii') ==> CodecLookupError Same comment. > str.transform('bz2') ==> CodecLookupError A lookup error is surprising here. It may be a TypeError instead. The bz2 can be used with .transform, but not on str. So: - Lookup error if the codec cannot be used with encode/decode or transform/untransform - Type error if the value type is invalid (CodecLookupError doesn't exist, you propose to define a new exception who inherits from LookupError?) ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue7475> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com