Movatterモバイル変換
[0]ホーム
[Python-Dev] buffer('abc') == 'abc' is False ?!
M.-A. Lemburgmal@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 fromtext data. This information can sometimes be deducedfrom the string content provided you know what text datameans to you, but this doesn't always work, since sometimesbinary data happens to look like text data (ie. use onlycharacter ordinals as data bytes).-- Marc-Andre LemburgCEO 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/
[8]ページ先頭