Hello everybody, I recently discovered that os.path.commonprefix(list-of-strings) returns the longest substring that is an initial segment of all the given strings, and that this has nothing to do with the fact that the strings might be paths. I wonder why this has been put in os.path and not in the string module in the first place. This location misled me for a long time into thinking that commonprefix() would return the longest common *path*, a feature whose interest I could see. But: >>> commonprefix(['/home/users/arigo', '/home/users/alal']) '/home/users/a' What is the use for such a thing ?? I suggest that a more descriptive comment be added in the documentation. Armin
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4