Kaydet (Commit) 528f8810 authored tarafından Georg Brandl's avatar Georg Brandl

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

üst 8ad554fd
...@@ -425,6 +425,26 @@ available. They are listed here in alphabetical order. ...@@ -425,6 +425,26 @@ available. They are listed here in alphabetical order.
The float type is described in :ref:`typesnumeric`. The float type is described in :ref:`typesnumeric`.
.. function:: format(value[, format_spec])
.. index::
pair: str; format
single: __format__
Convert a *value* to a "formatted" representation, as controlled by
*format_spec*. The interpretation of *format_spec* will depend on the type
of the *value* argument, however there is a standard formatting syntax that
is used by most built-in types: :ref:`formatspec`.
.. note::
``format(value, format_spec)`` merely calls
``value.__format__(format_spec)``.
.. versionadded:: 2.6
.. function:: frozenset([iterable]) .. function:: frozenset([iterable])
:noindex: :noindex:
......
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