title: How/where to use os.path.sep?
body: <p><code>os.path.sep</code> is the character used by the operating system to separate pathname components.</p>
  
  <p>But when <code>os.path.sep</code> is used in <code>os.path.join()</code>, why does it truncate the path?</p>
  
  <p>Example:</p>
  
  <p>Instead of <code>'home/python'</code>, <code>os.path.join</code> returns <code>'/python'</code>:</p>
  
  <pre><code>&gt;&gt;&gt; import os
  &gt;&gt;&gt; os.path.join('home', os.path.sep, 'python')
  '/python'
  </code></pre>
  
  <p>I know that <a href="https://docs.python.org/2/library/os.path.html#os.path.join" rel="nofollow"><code>os.path.join()</code></a> inserts the directory separator implicitly. </p>
  
  <p>Where is <code>os.path.sep</code> useful? Why does it truncate the path?</p>