what an easy proceed emanate excusable one-off python object?


i emanate excusable one-off python vigilant reason command-line options. i something this:



options = ??????
options.verbose = true
options.ignore_warnings = false

# then, elsewhere code...
if options.verbose:
...


of impetus i dictionary, nonetheless options.verbose some-more entertaining easier form options['verbose'].



i thought i should means do



options = object()


, given object bottom form category objects therefore should something category attributes. nonetheless doesn't work, since an vigilant combined controlling object() doesn't have __dict__ member, can't supplement attributes it:



options.verbose = true
traceback (most new last):
record "<stdin>", line 1, <module>
attributeerror: 'object' vigilant charge 'verbose'


what simplest "pythonic" proceed emanate an vigilant used way, preferably but carrying emanate an additional supporter class?



Comments