classification
Title: Add more entries to os module to pathlib reference table
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: asvetlov, docs@python, miss-islington, xtreak
Priority: normal Keywords: patch

Created on 2018-09-27 18:00 by xtreak, last changed 2018-10-05 16:07 by asvetlov. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 9608 merged xtreak, 2018-09-27 18:09
PR 9717 merged miss-islington, 2018-10-05 15:24
Messages (3)
msg326577 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2018-09-27 18:00
I found issue33194 where unlink from pathlib can be used to delete a file or symlink similar to os.unlink or os.remove but the visibility for the function was low. I found there is a reference table with os module functions and their equivalent pathlib methods. I think this can be improved by adding an entry for Path.unlink as an equivalent for os.remove and os.unlink. I would suggest adding some more functions to this table. The added functions are as below : 

:func:`os.chmod`                       :meth:`Path.chmod`
:func:`os.mkdir`                       :meth:`Path.mkdir`
:func:`os.rename`                      :meth:`Path.rename`
:func:`os.replace`                     :meth:`Path.replace`
:func:`os.rmdir`                       :meth:`Path.rmdir`
:func:`os.remove`, :func:`os.unlink`   :meth:`Path.unlink` 
:func:`os.path.samefile`               :meth:`Path.samefile`

The only issue is that some functions have a dir_fd=None in os module and I think this table is used for functions that do equivalent actions and not as drop-in replacements with equal type signatures. Feedback welcome. Since the table is present only on 3.7 and master I am leaving 3.6 for versions. I will push a PR shortly for this.

Thanks
msg327142 - (view) Author: miss-islington (miss-islington) Date: 2018-10-05 15:24
New changeset 6f9c55d1c0bb399911ded00bb6b3e6f43a514ea2 by Miss Islington (bot) (Xtreak) in branch 'master':
bpo-34825: Add more entries to os to pathlib reference table (GH-9608)
https://github.com/python/cpython/commit/6f9c55d1c0bb399911ded00bb6b3e6f43a514ea2
msg327144 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2018-10-05 16:06
New changeset 29c40c73143fee3612147959779b6927cd1be7e1 by Andrew Svetlov (Miss Islington (bot)) in branch '3.7':
bpo-34825: Add more entries to os to pathlib reference table (GH-9608) (#9717)
https://github.com/python/cpython/commit/29c40c73143fee3612147959779b6927cd1be7e1
History
Date User Action Args
2018-10-05 16:07:36asvetlovsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2018-10-05 16:06:20asvetlovsetnosy: + asvetlov
messages: + msg327144
2018-10-05 15:24:25miss-islingtonsetpull_requests: + pull_request9100
2018-10-05 15:24:16miss-islingtonsetnosy: + miss-islington
messages: + msg327142
2018-09-27 18:09:25xtreaksetkeywords: + patch
stage: patch review
pull_requests: + pull_request9006
2018-09-27 18:00:22xtreakcreate