Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:

There are other issues with the documentation of splitext().

1. It uses term "extension" (it is even a part of function name), but it is 
vague and usually does not include a period. On Windows the extension of 
"python.exe" is "exe", not ".exe". On Unix term "suffix" is commonly used, 
".exe" is a suffix. It is also used in pathlib. I suggest to replace 
"extension" with "suffix".

2. It is not specified that only the part of the last path component is 
included in the suffix, and leading periods of the last path component are 
ignored, not just leading periods of the path. So splitext('mail.dir/') == 
('mail.dir/', '') and splitext('/home/user/.etc') is ('/home/user/.etc', ''). 
It is not documented that splitext() works with multi-component paths at all.

----------
nosy: +pitrou

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue34931>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to