O'Reilly logo
  • You Wang thinks this is interesting:

This file works identically in Python 2.X and 3.X. When run directly, it tests itself as before, but it uses options on the command line to control the test behavior.

From

Cover of Learning Python, 5th Edition

Note

improve speed if put the def inside 'if' route