On 13/06/2024 02:20, Rob Cliffe wrote:
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 wr
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 ma
This being in `os.path` module suggests that the main intent is to find a
common prefix of a `path`.
If this is the case, maybe it would be worth instead of:
```
if not isinstance(m[0], (list, tuple)):
m = tuple(map(os.fspath, m))
```
have
```
if not isinstance(m[0], (list, tuple)):
[Rob Cliffe]
> The os.path.commonprefix function basically returns the common initial
> characters (if any) shared by a sequence of strings, e.g.
> ...
> It seems to me that this function (or something similar) should not be
> in os.path, but somewhere else where it would be more visible.
It's ce