]> granicus.if.org Git - python/commitdiff
Clarify the os.fspath() documentation.
authorBrett Cannon <brett@python.org>
Thu, 9 Jun 2016 21:37:06 +0000 (14:37 -0700)
committerBrett Cannon <brett@python.org>
Thu, 9 Jun 2016 21:37:06 +0000 (14:37 -0700)
Doc/library/os.rst

index deabaebe72a4ecbebe7818756ba8245a3cf4ffbe..3dca86e47353e1d72c306405fae0874fba3c0bc1 100644 (file)
@@ -188,11 +188,12 @@ process and user.
 
 .. function:: fspath(path)
 
-   Return the string representation of the path.
+   Return the file system representation of the path.
 
    If :class:`str` or :class:`bytes` is passed in, it is returned unchanged;
-   otherwise, the result of calling ``type(path).__fspath__`` is returned, or an
-   exception is raised.
+   otherwise, the result of calling ``type(path).__fspath__`` is returned
+   (which is represented by :class:`os.PathLike`). All other types raise a
+   :exc:`TypeError`.
 
 
 .. function:: getenv(key, default=None)