[Python-Dev] A wart which should have been repaired in 3.0? (original) (raw)

Jeff Hall hall.jeff at gmail.com
Mon Dec 29 22:49:26 CET 2008


I think Nick's solution is "Don't let the best be the enemy of the good"

Had this been caught before 3.0 release it might be a different solution

Let's just add a new function that works "correctly"

Martin, it seems to me that a path. method shouldn't require me to pass path components but instead should accept a "path" as its input (or in this case multiple paths). The current usage feels like a string method to me. Not saying it's not useful but it isn't "intuitive".

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 = "/")

would properly return

'bob/' -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20081229/b8e64872/attachment.htm>



More information about the Python-Dev mailing list