Python Doc Problem Example: os.path.split

Xah Lee xah at
Sun Sep 18 12:46:03 CEST 2005

Python Doc Problem Example

Quote from:
split(  	path)
    Split the pathname path into a pair, (head, tail) where tail is the
last pathname component and head is everything leading up to that. The
tail part will never contain a slash; if path ends in a slash, tail
will be empty. If there is no slash in path, head will be empty. If
path is empty, both head and tail are empty. Trailing slashes are
stripped from head unless it is the root (one or more slashes only). In
nearly all cases, join(head, tail) equals path (the only exception
being when there were multiple slashes separating head from tail).

Can anyone tell me what this verbiage is trying to fucking say?

what the fuck is with the head and tail thing?

is the doc writer, trying to write the doc with some austereness, but
is confused about the behavior of split, or confused about expressing
it? Did his pretension fucked him up?

i was working on a program where i needed to split a path into dirname,
corename, and suffix. But this fucking python doc diverted my work and
wasted my time. It normally isn't a problem to find imperfections in
the world except the fucking OpenSourcers fuck with their fucking
moronicity and moronitude and propagate haughtily their fucking lies
and stupidity. Die.

Suggested rewrite:

	returns a pair (dirname,filename), where dirname is the part of path
up to the last slash, and filename is the rest of the string after the
last slash.

Exceptional cases are:
• if path is a single slash (or repeated), then path == dirname and
filename is empty.
• If the “last” slash is repeated, they are treated as one single

Fuck the motherfucking liers of OpenSourcing fuckheads.
(Note: my use of OpenSource here does not include people of GNU

For more about Python Doc problems, see

 xah at xahlee.org

More information about the Python-list mailing list