Development of an internal social media platform with personalised dashboards for students
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

anomalous_unicode_escape_py3.py 672B

12345678910111213141516171819
  1. # pylint:disable=W0105, W0511
  2. """Test for backslash escapes in byte vs unicode strings"""
  3. # Would be valid in Unicode, but probably not what you want otherwise
  4. BAD_UNICODE = b'\u0042' # [anomalous-unicode-escape-in-string]
  5. BAD_LONG_UNICODE = b'\U00000042' # [anomalous-unicode-escape-in-string]
  6. # +1:[anomalous-unicode-escape-in-string]
  7. BAD_NAMED_UNICODE = b'\N{GREEK SMALL LETTER ALPHA}'
  8. GOOD_UNICODE = u'\u0042'
  9. GOOD_LONG_UNICODE = u'\U00000042'
  10. GOOD_NAMED_UNICODE = u'\N{GREEK SMALL LETTER ALPHA}'
  11. # Valid raw strings
  12. RAW_BACKSLASHES = r'raw'
  13. # In a comment you can have whatever you want: \ \\ \n \m
  14. # even things that look like bad strings: "C:\Program Files"