title: How to enable python repl autocomplete and still allow new line tabs
body: <p>I currently have the following in <code>~/.pythonrc</code> to enable auto completion in the python repl:</p>
  
  <pre><code># Autocompletion
  import rlcompleter, readline
  readline.parse_and_bind('tab:complete')
  </code></pre>
  
  <p>However, when I <code>tab</code> from the start of a new line (for instance, on the inner part of a for loop), I get a list of suggestions instead of a <code>tab</code>.</p>
  
  <p>Ideally, I would want to get suggestions only following a non-whitespace character.</p>
  
  <p>Is this straightforward to implement in a <code>~/.pythonrc</code>?</p>