-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
os.path.splitext documentation needs typical example #79364
Comments
As with many entries on the os.path doc page, splitext needs a typical example. Not grokking the bare minimum text, I had to actually try it in the interpreter to see what it did. The one example that *is* there is an edge case, and does nothing to explain the normal behavior, or why this is the correct behavior for the edge case. Here is where I tripped up: Split the pathname path into a pair (root, ext) such that root + ext == path, and ext is empty or begins with a period and contains at most one period. One interpretation of this is that ext is either empty, or has a period, _and nothing else_. Here are 2 examples for typical use: >>> splitext('readme.txt')
('readme', '.txt')
>>> splitext('/some/long/pathname/warble.csv')
('/some/long/pathname/warble', '.csv') |
Hello, I would like to submit a PR for this. It'll be my first contribution to cPython and I am slightly unclear if this suggestion has been "accepted" in some sense (i.e. do the Devs agree it should be fixed as suggested)? If so, I will go ahead and create PR (and credit shaungriffith for his provided examples). |
@jstockwin, the process usually goes like this:
There's no need to credit anyone – if Shaun wanted credit, he could have included a PR with his bug report! Plus, the commit will include this bpo#, so future onlookers can always trace the commit back to this thread. Follow the dev guide as you go and don't hesitate to post any questions you have right here! |
Thanks for the info, @jack__d - very helpful. |
Thanks, Jake! ✨ 🍰 ✨ |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: