A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-October/029623.html below:

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

[Python-Dev] buffer('abc') == 'abc' is False ?!Guido van Rossum guido@python.org
Wed, 16 Oct 2002 10:31:02 -0400
> >>* 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).

I don't understand why you need to signal "this is binary data" while
at the same time you want to be able to compare to strings.

Also, since buffer objects *can't* be compared to strings right now,
and you require compatibility with 2.1, there is no solution that
satisfies your requirements, so I conclude you're just being
"difficult". :-)

--Guido van Rossum (home page: http://www.python.org/~guido/)



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4