Author vstinner
Recipients belopolsky, benjamin.peterson, cben, eric.araujo, flox, georg.brandl, gvanrossum, lemburg, loewis, ncoghlan, ssbarnea, vstinner
Date 2011-10-19.23:10:52
SpamBayes Score 0.00601903
Marked as misclassified No
Message-id <201110200111.56344.victor.stinner@haypocalc.com>
In-reply-to <CADiSq7fZnur9+7jW9AH_zRbcmua2OUnrqAV+RsDp1ryfxjFsuA@mail.gmail.com>
Content
> 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()
History
Date User Action Args
2011-10-19 23:10:53vstinnersetrecipients: + vstinner, lemburg, gvanrossum, loewis, georg.brandl, cben, ncoghlan, belopolsky, benjamin.peterson, eric.araujo, ssbarnea, flox
2011-10-19 23:10:52vstinnerlinkissue7475 messages
2011-10-19 23:10:52vstinnercreate