title: Disabling nagle in python: how to do it the right way?
body: <p>I need to disable nagle algorithm in python2.6.
  I found out that patching HTTPConnection in httplib.py that way</p>
  
  <pre><code>    def connect(self):
          """Connect to the host and port specified in __init__."""
          self.sock = socket.create_connection((self.host,self.port),
                                           self.timeout)
          self.sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, True) # added line
  </code></pre>
  
  <p>does the trick.</p>
  
  <p>Obviously, I would like to avoid patching system lib if possible. So, the question is: what is right way to do such thing? (I'm pretty new to python and can be easily missing some obvious solution here)</p>