Message350386
> \N{name} : named character
> \UXXXXXXXX : 32-bit hexadecimal ordinal (e.g. \U0010ffff)
> \uXXXX : 16-bit hexadecimal ordinal (e.g. \uffff)
> \xXX : 8-bit hexadecimal ordinal (e.g. \xff)
> \OOO : 9-bit octal ordinal (e.g. \777)
> \OO : 6-bit octal ordinal (e.g. \77)
> \O : 3-bit octal ordinal (e.g. \7)
Note that bytes literals do not implement \N, \U, and \u escape sequences -- e.g. b'\N{SPACE}' is literally just those 9 bytes, not b' '. Also, in bytes literals 9-bit octal sequences wrap around for the [256, 511] range -- e.g. b'\400' == b'\000' == b'\x00' and b'\777' == b'\377' == b'\xff'. I don't know whether the latter is intentional. I'd prefer for the compiler to raise a syntax error in this case. Asking for a byte value in the range [256, 511] is nonsense. |
|
Date |
User |
Action |
Args |
2019-08-24 17:58:58 | eryksun | set | recipients:
+ eryksun, xtreak, Yugi |
2019-08-24 17:58:58 | eryksun | set | messageid: <1566669538.49.0.937772359505.issue37939@roundup.psfhosted.org> |
2019-08-24 17:58:58 | eryksun | link | issue37939 messages |
2019-08-24 17:58:58 | eryksun | create | |
|