You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PEP 701 introduced with python version 3.12.3 claims to be backwards compatible.
But in python version 3.12.2 the string "\.00" gives \\.00 and since python version 3.12.3 I get the follwing error: <stdin>:1: SyntaxWarning: invalid escape sequence '\.' '\\.00'
The referenced commit is about octal sequences above 0o377. The warning results from changing the invalid escape sequence warning from DeprecationWarning (usually invisible) to SyntaxWarning (usually visible, but not currently in IDLE and other possible circumstances) in 3.12 in issue #98401, PR #99011. The same warning occurs with '\.a' and '\.'.
Ahh ok that explains everything. I got this Error because Mathematica’s ExternalEvaluate uses an invalid escape sequence and I knew that in march all was working fine. I regularly update my system so I thought I was using python version 3.12.2 in march. But it turns out that Archlinux doesn’t update their python package that often, therefore I was using version 3.11.8 instead.
Activity
pablogsal commentedon May 23, 2024
That has nothing to be with PEP 701. PEP 701 is about f-strings, not about strings in general. That change was introduced here:
3483299a24e4
terryjreedy commentedon May 23, 2024
The referenced commit is about octal sequences above 0o377. The warning results from changing the invalid escape sequence warning from DeprecationWarning (usually invisible) to SyntaxWarning (usually visible, but not currently in IDLE and other possible circumstances) in 3.12 in issue #98401, PR #99011. The same warning occurs with
'\.a'and'\.'.The change was in 3.12.0 and noted in What' New 3.12:
If you want a single backslash in the string, either double it or precede the string with 'r':
'\\.00' == r'\.00'isTrue.[-]PEP 701 is not backwards compatible[/-][+]Invalid escape sequences raise SyntaxWarning[/+]Okarin99 commentedon May 23, 2024
Ahh ok that explains everything. I got this Error because Mathematica’s ExternalEvaluate uses an invalid escape sequence and I knew that in march all was working fine. I regularly update my system so I thought I was using python version 3.12.2 in march. But it turns out that Archlinux doesn’t update their python package that often, therefore I was using version 3.11.8 instead.