Cheatsheet in python help (especially for number formatting specification language)

When I need a reminder of the format specifier options (like 'f{number:.2f}') without opening a web browser or a book, I type help('FORMATTING') in a python console and scroll to the “Format Specification Mini-Language” section.
I wish there was a stripped down version of that section (that does not reexplain the whole process, but display the tables and specific details briefly), with minimum scrolling required.

(Imagine you have to develop a program, but you have no internet access !)

→ 3 questions :

  • What will be the syntax to access the cheatsheet (e.g. help("cheat:FORMATTING")) ?
  • What are other problems that might require a cheatsheet (e.g. ‘choosing which exception type to raise’, ‘choosing the best datastructure for my problem’, …) ?
  • Is it worth adding it to pydoc, or some stdlib ‘extended pydoc’ ?
1 Like