Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Well Python 2 "protects" you from silly things like that and throws a syntax error.

  In [4]: class АnotherClass():
     ...:     pass
    File "<ipython-input-4-ad6e67ea5e19>", line 1
      class АnotherClass():
            ^
  SyntaxError: invalid syntax


Add a file encoding directive[1] at the begining of your file, and you can shoot at as many of your feet as you want.

[1] PEP 0263: https://www.python.org/dev/peps/pep-0263/


In Python 2 that only works within string literals, though.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: