STINNER Victor <victor.stin...@haypocalc.com> added the comment:

> Those two encoder functions were meant to be used by Python codec
> implementations which want to use the readbuffer and charbuffer
> interfaces available in Python via "s#" and "t#" to access input
> object data.

Ah ok.

> They are not used by the builtin codecs, 
> but may well be in use by 3rd party codecs.

My quick Google search didn't found any of those. I suppose that str and bytes 
are enough for most people. Do you know an usecase of text or bytes stored in 
different types than str and bytes? (I suppose the bytearray is compatible with 
bytes, and so it can be used instead of bytes)

> I'm not sure why you think those functions are not encoders.

I consider that Python3 codecs module only encode and decode text to/from an 
encoding, whereas Python2 had extra unrelated codecs like "base64" or "hex" 
(but it was decided to remove them to cleanup the codecs module).

----------
title: Remove codecs.readbuffer_encode() and    codecs.charbuffer_encode() -> 
Remove codecs.readbuffer_encode() and codecs.charbuffer_encode()

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue8838>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to