Recently, I have been reading about the Python source code encoding, especially PEP 263 and PEP 3120.
I have the following code:
# coding:utf-8
s = 'abc∂´ƒ©'
ƒ = 'My name is'
ß = '˚ß˙ˆ†ˆ∆ ßå®åø©ˆ'
print('s =', s)
print('ƒ =', ƒ, 'ß =', ß)
This code works fine for Python3 but results in a SyntaxError
in Python2.7 .
I do understand that this probably might have nothing to do with source code encoding.
So, I would like to know if there is a way to support Unicode variable names in Python2.
In all, I am also having a hard time figuring out what pragmatic problem the PEPs exactly aim to solve and how(and where) do I take advantage of the proposed solutions. I have read few discussions on the same but they do not present an answer to my question rather an explanation of the correct syntax: