More precise document on os.path.normpath()

P

Peng Yu

After I tried os.path.normpath(), it is clear that the function
doesn't return the trailing '/', if the path is a directory. But this
fact is not documented. Should this be documented in future release of
python.

Also, I found the documentation of some functions in os.path are not
clear. I have to try them in order to understand them for corner
cases. I'm wondering if I can join the people who maintain the
document to help improve it.
 
L

Lie Ryan

Peng said:
After I tried os.path.normpath(), it is clear that the function
doesn't return the trailing '/', if the path is a directory. But this
fact is not documented. Should this be documented in future release of
python.

Also, I found the documentation of some functions in os.path are not
clear. I have to try them in order to understand them for corner
cases. I'm wondering if I can join the people who maintain the
document to help improve it.

os.path is designed for OS-agnostic path manipulation. The textual
representation of the output of os.path is irrelevant. If a trailing '/'
doesn't affect the ability to open the directory or file or os.path.join
or whatever, it is irrelevant to os.path. If the trailing / does affect
those abilities, though, it is a bug in os.path.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top