As it parses the command line, optparse sets attributes of the options object returned by parse_args() based on user-supplied command-line values.
docs.python.org