Ask Your Question

Revision history [back]

from __future__ import unicode_literals and variable names

Hello

It seems that making

from __future__ import unicode_literals

create some strange behaviour in Sage :

sage: from __future__ import unicode_literals
sage: x=var('x')
sage: f(x)=x**2   #ok
sage: f(3)
9
sage: f(x=3)    # Not ok at all
u'x'^2

While it works when I force the argument of var to be str:

sage: y=var(str('y'))
sage: f(y)=y**2
sage: f(3)       #ok
9
sage: f(y=3)     #ok again
9

Should I forget about unicode_literals or open a ticket agains the var function which should convert its argument into a str ?

Thanks for advises

Laurent