Using print statements in level scope may result in surprising output at import time. This in turn means that other code cannot safely import the module in question if the program may only write real output to standard out.

Replace the print statements with calls to some form of logging function or use the warnings module.

In the example, importing the module may cause a message to be printed, which may interfere with the operation of the program.

  • Python Language Reference: The print statement.
  • Python Standard Library: The print function.
  • Python tutorial: Modules.