On 11/9/18 11:19 PM, Steven D'Aprano wrote:
> On Sat, Nov 10, 2018 at 12:56:07PM +1100, Chris Angelico wrote:
>
>> Not ambiguous. It takes as many valid octal digits as it can.
> What is the rationale for that? Hex escapes don't.
>
> My guess is, "Because that's what C does". And C probably does it
On Sat, Nov 10, 2018 at 3:19 PM Steven D'Aprano wrote:
>
> On Sat, Nov 10, 2018 at 12:56:07PM +1100, Chris Angelico wrote:
>
> > Not ambiguous. It takes as many valid octal digits as it can.
>
> What is the rationale for that? Hex escapes don't.
Irrelevant to whether it's ambiguous or not.
> > "
On Sat, Nov 10, 2018 at 12:56:07PM +1100, Chris Angelico wrote:
> Not ambiguous. It takes as many valid octal digits as it can.
What is the rationale for that? Hex escapes don't.
My guess is, "Because that's what C does". And C probably does it
because "Dennis Ritchie wanted to minimize the num
On Fri, 9 Nov 2018 at 23:56, Chris Angelico wrote:
> >>> list("\797")
> ['\x07', '9', '7']
> The octal escape grabs as many digits as it can, and when it finds a
> character in the literal that isn't a valid octal digit (same whether
> it's a '9' or a 'q'), it stops. The remaining characters have
On Sat, Nov 10, 2018 at 12:42 PM Joao S. O. Bueno wrote:
>
> I just saw some document which reminded me that strings with a
> backslash followed by 3 octal digits. When a backslash is followed by
> 3 octal digits, that means a character with the corresponding
> codepoint and all is well.
>
> The "
I just saw some document which reminded me that strings with a
backslash followed by 3 octal digits. When a backslash is followed by
3 octal digits, that means a character with the corresponding
codepoint and all is well.
The "valid scenaario":
In [42]: "\777"
Out[42]: 'ǿ'
The problem is when yo