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/084633.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?Scott David Daniels Scott.Daniels at Acm.Org
Mon Dec 29 23:02:20 CET 2008
Jeff Hall wrote:
>... For those that prefer not to add functions all willy-nilly, would it not 
> be better to add a "delimiter" keyword that defaults to False? Then 
> "delimiter=False" will function with the current functionality unchanged 
> while
> 
> os.path.commonprefix(["bob/export/home", "bob/etc/passwd"], delimiter = 
> "/")

The proper call should be:
os.path.commonprefix(["bob/example", "bob/etc/passwd"], delimiter=True)

and output:
        'bob'   (path to the common directory)

Perhaps even call the keyword arg "delimited," rather than "delimiter."
On Windows, I'd like to see:
   os.path.commonprefix(['a/b/c.d/e'f', r'a\b\c.d\eve'], delimited=True)
return either
      'a/b/c.d'
  or  r'a\b\c.d'
Perhaps even ['a', 'b', 'c.d'] (suitable for os.path.join).

--Scott David Daniels
Scott.Daniels at Acm.Org

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