mirror of
https://github.com/python/cpython.git
synced 2025-07-24 19:54:21 +00:00
gh-82849: revise intro to os.path.rst (GH-32232)
* revise the first paragraph of docs for os.path * add a mention of `os.PathLike` protocol * remove warnings rendered irrelevant by :pep:`383` and :pep:`529` Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
parent
a861756675
commit
468314cc8b
2 changed files with 7 additions and 11 deletions
|
@ -11,16 +11,10 @@
|
||||||
|
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
This module implements some useful functions on pathnames. To read or
|
This module implements some useful functions on pathnames. To read or write
|
||||||
write files see :func:`open`, and for accessing the filesystem see the
|
files see :func:`open`, and for accessing the filesystem see the :mod:`os`
|
||||||
:mod:`os` module. The path parameters can be passed as either strings,
|
module. The path parameters can be passed as strings, or bytes, or any object
|
||||||
or bytes. Applications are encouraged to represent file names as
|
implementing the :class:`os.PathLike` protocol.
|
||||||
(Unicode) character strings. Unfortunately, some file names may not be
|
|
||||||
representable as strings on Unix, so applications that need to support
|
|
||||||
arbitrary file names on Unix should use bytes objects to represent
|
|
||||||
path names. Vice versa, using bytes objects cannot represent all file
|
|
||||||
names on Windows (in the standard ``mbcs`` encoding), hence Windows
|
|
||||||
applications should use string objects to access all files.
|
|
||||||
|
|
||||||
Unlike a unix shell, Python does not do any *automatic* path expansions.
|
Unlike a unix shell, Python does not do any *automatic* path expansions.
|
||||||
Functions such as :func:`expanduser` and :func:`expandvars` can be invoked
|
Functions such as :func:`expanduser` and :func:`expandvars` can be invoked
|
||||||
|
@ -38,7 +32,6 @@ the :mod:`glob` module.)
|
||||||
their parameters. The result is an object of the same type, if a path or
|
their parameters. The result is an object of the same type, if a path or
|
||||||
file name is returned.
|
file name is returned.
|
||||||
|
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
Since different operating systems have different path name conventions, there
|
Since different operating systems have different path name conventions, there
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
Update the introduction to documentation for :mod:`os.path` to remove
|
||||||
|
warnings that became irrelevant after the implementations of :pep:`383` and
|
||||||
|
:pep:`529`.
|
Loading…
Add table
Add a link
Reference in a new issue