[Python-Dev] bytes-like objects

Georg Brandl g.brandl at gmx.net
Sun Oct 5 18:59:56 CEST 2014


On 10/05/2014 06:11 PM, R. David Murray wrote:
> Over the past while we've been cleaning up the docs in the area of "how
> do we refer to bytes, bytearray, memoryview, etc, etc?" in the APIs that
> deal with bytes.  As you may or may not remember, we settled on the term
> 'bytes-like object', and have changed the docs to (we hope) consistently
> use this term, which has a glossary entry most of the references to it
> link to.
> 
> I just committed (to 3.5) the final changes for issue 16518, the change
> to consistently using the term 'bytes-like object' for things that
> support the buffer interface.  This means that messages that previously
> read:
> 
>     'sometype' does not support the buffer interface
> 
> now read
> 
>     a bytes-like object is required, not 'sometype'
> 
> The 'buffer interface' messages were rather confusing, since you have to
> dig to find out what the 'buffer interface' is.  It isn't any sort of
> python object, nor is there any object in python3 that has a name
> related to it.  'bytes-like object', on the other hand, is fairly
> intuitive[*], and if you look it up in the glossary it links to the
> explanation of the buffer interface.
> 
> We felt it was worth explicitly mentioning this patch on python-dev to point
> out to everyone that the docs and error messages now use a consistent
> terminology, instead of the mis-mash we had before, which should make it easier
> to help people with issues where this comes up.
> 
> If there are objections to this change to the messages it is easy enough to
> back out, but personally I find the new error messages *much* clearer, and I'm
> an experienced dev.

I agree. Thanks for the effort you two!

Georg


More information about the Python-Dev mailing list