[Python-Dev] buffer('abc') == 'abc' is False ?!

M.-A. Lemburg mal@lemburg.com
Wed, 16 Oct 2002 16:12:13 +0200


Martin v. Loewis wrote:
> "M.-A. Lemburg" <mal@lemburg.com> writes:
> 
> 
>>* signals "this data is binary data"
>>* compares just fine to strings
>>* gets accepted by all APIs which use the buffer interface to
>>   access the data
>>* has a C API which can be used in extensions
>>* is available in Python 2.1.x and up
> 
> 
> I believe the string type meets all these requirements.

Except one which was implicit: how to tell binary data from
text data. This information can sometimes be deduced
from the string content provided you know what text data
means to you, but this doesn't always work, since sometimes
binary data happens to look like text data (ie. use only
character ordinals as data bytes).

-- 
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
_______________________________________________________________________
eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,...
Python Consulting:                               http://www.egenix.com/
Python Software:                    http://www.egenix.com/files/python/