[Python-Dev] buffer('abc') == 'abc' is False ?!
M.-A. Lemburg
mal@lemburg.com
Wed, 16 Oct 2002 15:04:48 +0200
Guido van Rossum wrote:
>>I was wondering whether this is an oversight or intended. Buffer
>>objects can certainly be compared to strings on a byte-by-byte
>>basis, so the compare result looks like a (long standing)
>>bug to me.
>
>
> I'd consider it a feature, designed to convey the subliminal message
> "the buffer type should be deprecated". :-)
Fine, but what alternative is there which meets the following
requirements:
* 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
(other than rolling my own mxBinary type...)
What I'd basically need is a type which simply wraps up any
string data, plays nice with 8-bit strings and signals
the binary nature of the content.
--
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/