[Python-ideas] os.path.isparent and os.path.ischild

Brendan Moloney moloney at ohsu.edu
Fri Jul 8 21:38:13 CEST 2011


> Steven D'Aprano wrote:
> I would call that a bug in commonprefix.

The documentation on the website correctly describes this behavior (http://docs.python.org/library/os.path.html)  while the docstring does not. 

Someone tried to make the behavior more sane some time ago (http://bugs.python.org/issue400788) but this was reverted since it was backwards incompatible and the documentation correctly described the behavior.

There is currently an open issue (http://bugs.python.org/issue10395) to add a function that does what commonprefix should have done to start with. Once this function is present I see no need for an is{parent|child} function.

Brendan



More information about the Python-ideas mailing list