Message145982
| Author |
vstinner |
| Recipients |
belopolsky, benjamin.peterson, cben, eric.araujo, flox, georg.brandl, gvanrossum, lemburg, loewis, ncoghlan, ssbarnea, vstinner |
| Date |
2011年10月19日.22:34:48 |
| SpamBayes Score |
0.0059288824 |
| Marked as misclassified |
No |
| Message-id |
<1319063688.95.0.0614650932312.issue7475@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
> *.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?) |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2011年10月19日 22:34:49 | vstinner | set | recipients:
+ vstinner, lemburg, gvanrossum, loewis, georg.brandl, cben, ncoghlan, belopolsky, benjamin.peterson, eric.araujo, ssbarnea, flox |
| 2011年10月19日 22:34:48 | vstinner | set | messageid: <1319063688.95.0.0614650932312.issue7475@psf.upfronthosting.co.za> |
| 2011年10月19日 22:34:48 | vstinner | link | issue7475 messages |
| 2011年10月19日 22:34:48 | vstinner | create |
|