![](https://secure.gravatar.com/avatar/880ac02012dcaf99f0392f69af4f8597.jpg?s=120&d=mm&r=g)
June 17, 2024
7:28 a.m.
The os.path.commonprefix function basically returns the common initial characters (if any) shared by a sequence of strings, e.g. os.path.commonprefix(("Python is great!", "Python is not bad", "Python helps")) # returns "Python " The following was wrong. os.path.commonprefix uses min and max, not sort. I withdraw it: I also suspect that this function could be made more efficient. It sorts the sequence. While sorting is very fast (thanks, Uncle Tim!) it seems a bit OTT in this case. Thoughts? Best wishes Rob Cliffe
241
Age (days ago)
241
Last active (days ago)
0 comments
1 participants
participants (1)
-
Rob Cliffe