[New-bugs-announce] [issue34825] Add more entries to os module to pathlib reference table

Karthikeyan Singaravelan report at bugs.python.org
Thu Sep 27 14:00:22 EDT 2018


New submission from Karthikeyan Singaravelan <tir.karthi at 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 at python
components: Documentation
messages: 326577
nosy: docs at 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 at bugs.python.org>
<https://bugs.python.org/issue34825>
_______________________________________


More information about the New-bugs-announce mailing list