Anatomy of format mini-language

When the format function replaced buggy old style “interpolation” formatting (the one with the % substitution character) the mini-language of the format specification string was expanded and refined. (Note: in the following when we say “object:” we mean either a string or a number.) format comes in two flavors:
(1)    format(object, “mini-language-string”) and
(2)    “{:mini-language-string}”.format(object)

With the introduction of the still newer “f strings” in 3.6 we finally have a single unified syntax but the mini-language remains virtually intact. For a complete overview of all of the above see Big Daddy’s Python Toolbox, Formatting Options on www.wikipython.com. What follows is an…

ANATOMY OF THE FORMAT MINI-LANGUAGE: