summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2014-02-11 23:34:22 (GMT)
committerR David Murray <rdmurray@bitdance.com>2014-02-11 23:34:22 (GMT)
commitd630e79cc7ac59bd11faa2a4ad4f1d03a2e95c11 (patch)
treed16c588be0ce929226ece0e4dc5b09a024397bc2 /Doc/library
parent13b493e8a72395bd0b0ee3f72baf68aaa01704ab (diff)
downloadcpython-d630e79cc7ac59bd11faa2a4ad4f1d03a2e95c11.zip
cpython-d630e79cc7ac59bd11faa2a4ad4f1d03a2e95c11.tar.gz
cpython-d630e79cc7ac59bd11faa2a4ad4f1d03a2e95c11.tar.bz2
whatsnew: object.__format__ raises TypeError on non-empty string.
See issues #7994 and #9856. I also modified with wording of the format doc entry to better match what really happens, and added a versionchanged to the datamodel object.__format__ section.
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/functions.rst9
1 files changed, 5 insertions, 4 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index 4371969..57f015b 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -540,12 +540,13 @@ are always available. They are listed here in alphabetical order.
A call to ``format(value, format_spec)`` is translated to
``type(value).__format__(format_spec)`` which bypasses the instance
dictionary when searching for the value's :meth:`__format__` method. A
- :exc:`TypeError` exception is raised if the method is not found or if either
- the *format_spec* or the return value are not strings.
+ :exc:`TypeError` exception is raised if the method search reaches
+ :mod:`object` and the *format_spec* is non-empty, or if either the
+ *format_spec* or the return value are not strings.
- .. versionadded:: 3.4
+ .. versionchanged:: 3.4
``object().__format__(format_spec)`` raises :exc:`TypeError`
- if *format_spec* is not empty string.
+ if *format_spec* is not an empty string.
.. _func-frozenset: