anatoly techtonik wrote:
I wonder if it is possible to introduce an effective binary string
type that will be represented as h"XX XX XX" in language syntax?
Rather than a new type, maybe bytes objects could just have
a bit indicating whether they were best thought of as containing
characterish
On Tue, 27 Jul 2010 04:29:31 am anatoly techtonik wrote:
> I find "\xXX\xXX\xXX\xXX..." notation for binary data totally
> unreadable. Everybody who uses and analyses binary data is more
> familiar with plain hex dumps in the form of "XX XX XX XX...".
>
> I wonder if it is possible to introduce an
Am 26.07.2010 20:42, schrieb Alexandre Vassalotti:
> [+Python-ideas -Python-Dev]
>
> import binascii
> def h(s):
> return binascii.unhexlify("".join(s.split()))
>
> h("DE AD BE EF CA FE BA BE")
In Py3k:
h = bytes.fromhex
Georg
--
Thus spake the Lord: Thou shalt indent with four spaces. No
[+Python-ideas -Python-Dev]
import binascii
def h(s):
return binascii.unhexlify("".join(s.split()))
h("DE AD BE EF CA FE BA BE")
-- Alexandre
On Mon, Jul 26, 2010 at 11:29 AM, anatoly techtonik wrote:
> I find "\xXX\xXX\xXX\xXX..." notation for binary data totally
> unreadable. Everybody who
I find "\xXX\xXX\xXX\xXX..." notation for binary data totally
unreadable. Everybody who uses and analyses binary data is more
familiar with plain hex dumps in the form of "XX XX XX XX...".
I wonder if it is possible to introduce an effective binary string
type that will be represented as h"XX XX X