A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2008-December/084626.html below:

[Python-Dev] A wart which should have been repaired in 3.0?

[Python-Dev] A wart which should have been repaired in 3.0? [Python-Dev] A wart which should have been repaired in 3.0?"Martin v. Löwis" martin at v.loewis.de
Sun Dec 28 21:21:25 CET 2008
> I'm all for breaking backwards compatibility when it allows some genuine
> improvements that would otherwise be impossible, but in this particular
> case a little API bloat seems like the least of the available evils :)

I don't think any change is necessary. os.path.commonprefix works just
fine on path components:

py> p = ["/usr/bin/ls", "/usr/bin/ln"]
py> os.path.commonprefix([f.split('/') for f in p])
['', 'usr', 'bin']
py> p.append("/usr/local/bin/ls")
py> os.path.commonprefix([f.split('/') for f in p])
['', 'usr']

Of course, using it that way would require a library function that
reliably splits a path into components; I think one would have to do
abspath on arbitrary inputs.

Regards,
Martin
More information about the Python-Dev mailing list

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