Why does Python have a format function as well as a format method
tldr; format just calls obj.__format__ and is used by the str.format method which does even more higher level stuff. For the lower level it makes sense to teach an object how to format itself. It is just syntactic sugar The fact that this function shares the name and format specification with str.format can be misleading. … Read more