Backslash line continuation broken in Sage 9.2

37 views
Skip to first unread message

Eric Gourgoulhon

unread,
Nov 16, 2020, 6:08:36 AM11/16/20
to sage-devel
In Sage 9.2, attempting to define a callable symbolic expression with a backslash line continuation yields a syntax error:

sage: f(x) = x \
....:        + 1                                                                                    

  File "<ipython-input-2-a5c1e14e19da>", line 1
    __tmp__=var("x"); f = symbolic_expression(x  * BackslashOperator() * ).function(x)
                                                                         ^
SyntaxError: invalid syntax

There was no such issue in Sage 9.1.
A culprit might be https://trac.sagemath.org/ticket/28974, since it deals with the preparser and backslashes, but I am not sure...

Eric.

Eric Gourgoulhon

unread,
Nov 16, 2020, 6:50:03 AM11/16/20
to sage-devel
Le lundi 16 novembre 2020 à 12:08:36 UTC+1, Eric Gourgoulhon a écrit :
A culprit might be https://trac.sagemath.org/ticket/28974, since it deals with the preparser and backslashes, but I am not sure...


Sorry it cannot be that one, since it has been merged only in Sage 9.3.beta0

Eric Gourgoulhon

unread,
Nov 16, 2020, 11:48:54 AM11/16/20
to sage-devel
I've opened https://trac.sagemath.org/ticket/30928 and set it to critical, since it is a failure of some basic Python syntax,
which may surprise many users.
PS: at the moment, I cannot do better dichotomy than saying that Sage 9.1 is free from the bug and 9.2.beta14 is not.
Reply all
Reply to author
Forward
0 new messages