title: How to check if a string is a valid python identifier? including keyword check?
body: <p>Does anyone know if there is any builtin python method that will check if something is a valid  python variable name, INCLUDING a check against reserved keywords? (so, ie, something like 'in' or 'for' would fail...)</p>
  
  <p>Failing that, does anyone know of where I can get a list of reserved keywords (ie, dyanamically, from within python, as opposed to copy-and-pasting something from the online docs)?  Or, have another good way of writing your own check?</p>
  
  <p>Surprisingly, testing by wrapping a setattr in try/except doesn't work, as something like this:</p>
  
  <pre><code>setattr(myObj, 'My Sweet Name!', 23)
  </code></pre>
  
  <p>...actually works! (...and can even be retrieved with getattr!)</p>