[Python-Dev] Decoding incomplete unicode

Walter Dörwald walter at livinglogic.de
Fri Aug 13 22:04:04 CEST 2004


M.-A. Lemburg wrote:

> Hi Walter,
> 
> I don't have time to comment on this this week, I'll respond
> next week.

OK.

> Overall, I don't like the idea of adding extra
> APIs breaking the existing codec API.

Adding a final argument that defaults to False doesn't
break the API for the callers, only for the implementors.

And if we drop the final argument, the API is completely
backwards compatible both for users and implementors.
The only thing that gets added is the feed() method,
that implementors don't have to overwrite.

> I believe that we can
> extend stream codecs to also work in a feed mode without
> breaking the API.

Abandoning the final argument and adding a feed() method
would IMHO be the simplest way to do this.

But then there's no way to make sure that every byte from
the input stream is really consumed.

Bye,
    Walter Dörwald




More information about the Python-Dev mailing list