In this other question, the votes clearly show that the os.path.splitext function is preferred over the simple .split(\'.\')[-1] string manipulatio
The first and most obvious difference is that the split call has no logic in it to default when there is no extension.
This can also be accomplished by a regex, in order to get it to behave as a 1 liner without extra includes, but still return, empty string if the extension isn't there.
Also, the path library can handle different contexts for paths having different seperators for folders.