|
Data Structures and Algorithms
with Object-Oriented Design Patterns in Python |
A static method is a class attribute that does not require its first argument to be an instance of the class. (Normal methods require the first argument, self, to be a class instance).

Program: Complex class __main__ method.
Program
defines a main method for the Complex class.
This method is a simple test program for the Complex class.
For example,
this static method can be invoked like this:
import sys
if __name__ == "__main__":
sys.exit(Complex.main(*sys.argv))