diff options
author | Alex Waygood <Alex.Waygood@Gmail.com> | 2023-06-25 23:06:12 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-25 23:06:12 (GMT) |
commit | 93a970ffbce58657cc99305be69e460a11371730 (patch) | |
tree | 599086f9f8f32527b67951ed6fbf3fe9a1e7457f /Doc/reference | |
parent | 8c24a837371439b8e922ff47275085b581f510c5 (diff) | |
download | cpython-93a970ffbce58657cc99305be69e460a11371730.zip cpython-93a970ffbce58657cc99305be69e460a11371730.tar.gz cpython-93a970ffbce58657cc99305be69e460a11371730.tar.bz2 |
gh-106046: Improve error message from `os.fspath` if `__fspath__` is set to `None` (#106082)
Diffstat (limited to 'Doc/reference')
-rw-r--r-- | Doc/reference/datamodel.rst | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index e8f9775..7f5edbb 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -3179,8 +3179,9 @@ An example of an asynchronous context manager class:: lead to some very strange behaviour if it is handled incorrectly. .. [#] The :meth:`~object.__hash__`, :meth:`~object.__iter__`, - :meth:`~object.__reversed__`, and :meth:`~object.__contains__` methods have - special handling for this; others + :meth:`~object.__reversed__`, :meth:`~object.__contains__`, + :meth:`~object.__class_getitem__` and :meth:`~os.PathLike.__fspath__` + methods have special handling for this. Others will still raise a :exc:`TypeError`, but may do so by relying on the behavior that ``None`` is not callable. |