title: Why is '\x' invalid in Python?
body: <p>I was experimenting with '\' characters, using '\a\b\c...' just to enumerate for myself which characters Python interprets as control characters, and to what.  Here's what I found:</p>
  
  <pre><code>\a - BELL
  \b - BACKSPACE
  \f - FORMFEED
  \n - LINEFEED
  \r - RETURN
  \t - TAB
  \v - VERTICAL TAB
  </code></pre>
  
  <p>Most of the other characters I tried, '\g', '\s', etc. just evaluate to the 2-character string of a backslash and the given character.  I understand this is intentional, and makes sense to me.</p>
  
  <p>But '\x' is a problem.  When my script reaches this source line:</p>
  
  <pre><code>val = "\x"
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>ValueError: invalid \x escape
  </code></pre>
  
  <p>What is so special about '\x'?  Why is it treated differently from the other non-escaped characters?</p>