title: Python: Make `input` read and write to custom file descriptors
body: <p>I want <code>input(prompt)</code> to:</p>
  <ul>
  <li>read from <code>/dev/tty</code></li>
  <li>write its prompt to <code>stderr</code></li>
  </ul>
  <p>I found this by searching around, but I could not find where <code>readline_until_enter_or_signal</code> is defined. It seems to only be defined in the C code, and inaccessible in normal Python. I don't know how to call such a method.</p>
  <pre><code>def call_readline(stdin, stdout, prompt):
      '''Implementation of PyOS_Readline() in the &quot;readline&quot; module'''
      rl_instream = stdin
      rl_outstream = stdout  # Readline writes to stdout
      return readline_until_enter_or_signal(prompt)
  </code></pre>