Commit 5579ba91 authored by Georg Brandl's avatar Georg Brandl

#5348: format() converts all kinds of values.

parent 9249f803
...@@ -415,14 +415,15 @@ are always available. They are listed here in alphabetical order. ...@@ -415,14 +415,15 @@ are always available. They are listed here in alphabetical order.
pair: str; format pair: str; format
single: __format__ single: __format__
Convert a string or a number to a "formatted" representation, as controlled Convert a *value* to a "formatted" representation, as controlled by
by *format_spec*. The interpretation of *format_spec* will depend on the *format_spec*. The interpretation of *format_spec* will depend on the type
type of the *value* argument, however there is a standard formatting syntax of the *value* argument, however there is a standard formatting syntax that
that is used by most built-in types: :ref:`formatspec`. is used by most built-in types: :ref:`formatspec`.
.. note:: .. note::
``format(value, format_spec)`` merely calls ``value.__format__(format_spec)``. ``format(value, format_spec)`` merely calls
``value.__format__(format_spec)``.
.. function:: frozenset([iterable]) .. function:: frozenset([iterable])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment