I've been looking around several posts on class initialization in python (e.g. Ref1, Ref2, Ref3) but I couldn't find if there's a clean way to require certain inputs. What would be the best approach to make a named argument required and throw a consistent exception if the argument is not included?
I would like to have a similar functionality to the require
parameter of the add_argument()
method in ArgumentParser
.