title: Benefits of os.path.splitext over regular .split?
body: <p>In <a href="https://stackoverflow.com/questions/541390/extracting-extension-from-filename-in-python">this other question</a>, the votes clearly show that the <code>os.path.splitext</code> function is preferred over the simple <code>.split('.')[-1]</code> string manipulation. Does anyone have a moment to explain exactly why that is? Is it faster, or more accurate, or what? I'm willing to accept that there's something better about it, but I can't immediately see what it might be. Might importing a whole module to do this be overkill, at least in simple cases?</p>
  
  <p>EDIT: The OS specificity is a big win that's not immediately obvious; but even I should've seen the "what if there isn't a dot" case! And thanks to everybody for the general comments on library usage.</p>