Message145991
> I think it may even make sense to build the filtering
> options into codecs.lookup() itself:
>
> def lookup(encoding, decoded_format=None, encoded_format=None):
> info = _lookup(encoding) # The existing codec lookup algorithm
> if ((decoded_format is not None and decoded_format !=
> info.decoded_format) or
> (encoded_format is not None and encoded_format !=
> info.encoded_format)):
> raise CodecLookupError(info, decoded_format, encoded_format)
lookup('rot13') should fail with a lookup error to keep backward
compatibility. You can just change the default values to:
def lookup(encoding, decoded_format='text', encoded_format='binary'): ...
If you patch lookup, what about the following functions?
- getencoder()
- getdecoder()
- getincrementalencoder()
- getincrementaldecoder()
- getread()
- getwriter()
- itereencode() |
|
Date |
User |
Action |
Args |
2011-10-19 23:10:53 | vstinner | set | recipients:
+ vstinner, lemburg, gvanrossum, loewis, georg.brandl, cben, ncoghlan, belopolsky, benjamin.peterson, eric.araujo, ssbarnea, flox |
2011-10-19 23:10:52 | vstinner | link | issue7475 messages |
2011-10-19 23:10:52 | vstinner | create | |
|