Purpose of import this

To quote from the Python Enhancement Proposal (PEP) associated with this:
https://www.python.org/dev/peps/pep-0020/

“Long time Pythoneer Tim Peters succinctly channels the BDFL’s guiding
principles for Python’s design into 20 aphorisms, only 19 of which
have been written down.”

Thus, the stated purpose of this module is to spell out guidelines to related to the development of Python code.

Following these guidelines will likely improve the readability, usability and maintainability of Python code. None of which seem “useless”.

NOTE 1: the code that produces this list of guidelines purposely breaks most of them. = )

NOTE 2: BDFL stands for Benevolent Dictator for Life and referred to Guido van Rossum, the developer of Python.

If you are interested in learning more about the internal workings of the this module, see this stackoverflow post: Attributes of Python Module This.

Leave a Comment