Merge from 3.3: add hyperlinks to some os.path function docs (issue #16552).
This commit is contained in:
commit
b48f4ea601
|
@ -42,13 +42,15 @@ applications should use string objects to access all files.
|
||||||
.. function:: abspath(path)
|
.. function:: abspath(path)
|
||||||
|
|
||||||
Return a normalized absolutized version of the pathname *path*. On most
|
Return a normalized absolutized version of the pathname *path*. On most
|
||||||
platforms, this is equivalent to ``normpath(join(os.getcwd(), path))``.
|
platforms, this is equivalent to calling the function :func:`normpath` as
|
||||||
|
follows: ``normpath(join(os.getcwd(), path))``.
|
||||||
|
|
||||||
|
|
||||||
.. function:: basename(path)
|
.. function:: basename(path)
|
||||||
|
|
||||||
Return the base name of pathname *path*. This is the second half of the pair
|
Return the base name of pathname *path*. This is the second element of the
|
||||||
returned by ``split(path)``. Note that the result of this function is different
|
pair returned by passing *path* to the function :func:`split`. Note that
|
||||||
|
the result of this function is different
|
||||||
from the Unix :program:`basename` program; where :program:`basename` for
|
from the Unix :program:`basename` program; where :program:`basename` for
|
||||||
``'/foo/bar/'`` returns ``'bar'``, the :func:`basename` function returns an
|
``'/foo/bar/'`` returns ``'bar'``, the :func:`basename` function returns an
|
||||||
empty string (``''``).
|
empty string (``''``).
|
||||||
|
@ -63,8 +65,8 @@ applications should use string objects to access all files.
|
||||||
|
|
||||||
.. function:: dirname(path)
|
.. function:: dirname(path)
|
||||||
|
|
||||||
Return the directory name of pathname *path*. This is the first half of the
|
Return the directory name of pathname *path*. This is the first element of
|
||||||
pair returned by ``split(path)``.
|
the pair returned by passing *path* to the function :func:`split`.
|
||||||
|
|
||||||
|
|
||||||
.. function:: exists(path)
|
.. function:: exists(path)
|
||||||
|
@ -281,7 +283,8 @@ applications should use string objects to access all files.
|
||||||
*path* is empty, both *head* and *tail* are empty. Trailing slashes are
|
*path* is empty, both *head* and *tail* are empty. Trailing slashes are
|
||||||
stripped from *head* unless it is the root (one or more slashes only). In
|
stripped from *head* unless it is the root (one or more slashes only). In
|
||||||
all cases, ``join(head, tail)`` returns a path to the same location as *path*
|
all cases, ``join(head, tail)`` returns a path to the same location as *path*
|
||||||
(but the strings may differ).
|
(but the strings may differ). Also see the functions :func:`dirname` and
|
||||||
|
:func:`basename`.
|
||||||
|
|
||||||
|
|
||||||
.. function:: splitdrive(path)
|
.. function:: splitdrive(path)
|
||||||
|
|
Loading…
Reference in New Issue