12 Mar
2003
12 Mar
'03
5:04 p.m.
I'm not sure whether to classify this as a bug or a feature request. Recently, I got burned by the fact that despite the name, dirname() does not return the expected directory portion of a path if you pass it a directory, instead it will return the parent directory because it uses split.
This is the first time I've ever heard of this confusion. dirname is named after the Unix shell function of the same name, which behaves the same way. I'm not even sure I understand what you expected -- you expected dirname("foo") to return "foo" if foo is a directory? What would be the point of that? --Guido van Rossum (home page: http://www.python.org/~guido/)