PEP263 (Specifying encoding) and bytecode strings

Bengt Richter bokr at oz.net
Tue May 6 11:55:40 EDT 2003


On 06 May 2003 07:36:46 +0200, martin at v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) wrote:

>bokr at oz.net (Bengt Richter) writes:
>
>> Has there been any suggestions for a multicharacter hex escape, e.g.,
>> 'Something like \<ABCDEF> this?'
>
>What would be the exact meaning of such an escape, and why would it be
>useful?

assert '\<ABCDEF>' == '\xAB\xCD\xEF'

For more compact representation of multiple escaped characters
in a string literal, perhaps machine generated to represent binary.
EOLs and white space could be transparent inside the brackets, to make
nice blocked formatting, e.g.,
    s = '\<
        ABCD
        EF01
    >

Regards,
Bengt Richter




More information about the Python-list mailing list