kdavies4 / natu

Natural units in Python
http://kdavies4.github.io/natu/
Other
33 stars 5 forks source link

DeprecationWarning: invalid escape sequence #39

Open MinhHaDuong opened 4 years ago

MinhHaDuong commented 4 years ago

Line 331 in core.py and line 41 in exponents.py cause a DeprecationWarning: invalid escape sequence. This is expected to become a SyntaxError in Python 3.10.

References: https://docs.python.org/3.6/reference/lexical_analysis.html#string-and-bytes-literals https://bugs.python.org/issue32912

MinhHaDuong commented 4 years ago

Fix: add a 'r' character to declare the string as a raw string, and escape the backslash. replace '\,' by r'\\,' And add this comment \, is a LaTeX shorthand for \kern, which is 1/6th em rigid width, non breakable space.