[issue34825] Add more entries to os module to pathlib reference table

New submission from Karthikeyan Singaravelan <tir.karthi@gmail.com>: 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 ---------- assignee: docs@python components: Documentation messages: 326577 nosy: docs@python, xtreak priority: normal severity: normal status: open title: Add more entries to os module to pathlib reference table type: enhancement versions: Python 3.7, Python 3.8 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue34825> _______________________________________

Change by Karthikeyan Singaravelan <tir.karthi@gmail.com>: ---------- keywords: +patch pull_requests: +9006 stage: -> patch review _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue34825> _______________________________________

miss-islington <mariatta.wijaya+miss-islington@gmail.com> added the comment: 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/6f9c55d1c0bb399911ded00bb6b3e6f43a5... ---------- nosy: +miss-islington _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue34825> _______________________________________

Change by miss-islington <mariatta.wijaya+miss-islington@gmail.com>: ---------- pull_requests: +9100 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue34825> _______________________________________

Andrew Svetlov <andrew.svetlov@gmail.com> added the comment: 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/29c40c73143fee3612147959779b6927cd1... ---------- nosy: +asvetlov _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue34825> _______________________________________

Change by Andrew Svetlov <andrew.svetlov@gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue34825> _______________________________________
participants (3)
-
Andrew Svetlov
-
Karthikeyan Singaravelan
-
miss-islington