File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -498,11 +498,14 @@ are always available. They are listed here in alphabetical order.
498498 of the *value * argument, however there is a standard formatting syntax that
499499 is used by most built-in types: :ref: `formatspec `.
500500
501- .. note ::
502-
503- ``format(value, format_spec) `` merely calls
504- ``value.__format__(format_spec) ``.
505-
501+ The default *format_spec * is an empty string which usually gives the same
502+ effect as calling ``str(value) ``.
503+
504+ A call to ``format(value, format_spec) `` is translated to
505+ ``type(value).__format__(format_spec) `` which bypasses the instance
506+ dictionary when searching for the value's :meth: `__format__ ` method. A
507+ :exc: `TypeError ` exception is raised if the method is not found or if either
508+ the *format_spec * or the return value are not strings.
506509
507510.. function :: frozenset([iterable])
508511 :noindex:
You can’t perform that action at this time.
0 commit comments