The point of the __docformat__
is to allow python documentation generator tools such as epydoc to know how to properly parse the module documentation (e.g. which markup language to expect).
From the epydoc docs:
To specify the markup language for a module, you should define a module-level string variable __docformat__, containing the name of the module's markup language. The name of the markup language may optionally be followed by a language code (such as en for English). Conventionally, the definition of the __docformat__ variable immediately follows the module's docstring
However, many tools such as epydoc
also support specifying the markup language via command-line (e.g. epydoc --docformat restructuredtext
), so there is no strict need to include the docformat. It's more just whatever the coding conventions are for your project or organization.