[Python-checkins] cpython: Clarify the os.fspath() documentation.

brett.cannon python-checkins at python.org
Thu Jun 9 17:37:20 EDT 2016


https://hg.python.org/cpython/rev/dd5c0669cbd7
changeset: 101827:dd5c0669cbd7
user: Brett Cannon <brett at python.org>
date: Thu Jun 09 14:37:06 2016 -0700
summary:
 Clarify the os.fspath() documentation.
files:
 Doc/library/os.rst | 7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/Doc/library/os.rst b/Doc/library/os.rst
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -188,11 +188,12 @@
 
 .. 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)
-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /