I have a class that handles command line arguments in my program using python's optparse
module. It is also inherited by several classes to create subsets of parameters. To encapsulate the option parsing mechanism I want to reveal only a function add_option
to inheriting classes. What this function does is then call optparse.make_option
.
Is it a good practice to simply have my add_option
method say that it accepts the same arguments as optparse.make_option
in the documentation, and forward the arguments as *args
and **kwargs
?
Should I do some parameter checking beforehand? In a way I want to avoid this to decouple that piece of code as much from a specific version of optparse
.