1. 7

  2. 2

    The real problem here is that the help module requires that modules be actually imported, which requires the code to be executed. A better compromise would’ve been to have help('modules') only show documentation that can be statically determined by parsing (but not executing!) the modules.

    Sure, it’s bad practice to do stuff on import, but the act of importing itself takes out some locks and mutates global data and it can be much worse when importing C extensions that link to dynamic libraries. It can also be quite slow even when these modules are not doing bad things.