title: Python - import in if
body: <p>I wrote little wrapper for urllib (python3). Is it <strong>proper</strong> and <strong>safe</strong> to import module <em>in if</em>?</p>
  
  <pre><code>if self.response_encoding == 'gzip':
      import gzip
  </code></pre>
  
  <p>I didn't find any PEP about this code. However, it bothers me.</p>