Container for flexible class, instance, and function call options
options helps encapsulate options and configuration data using a layered stacking model (a.k.a. nested contexts).
For most functions and many classes, options is overkill and not recommended. Python’s already-flexible function arguments, *args, **kwargs, and inheritance patterns are elegant and sufficient for 99.9% of all development situations.
options is intended for the 0.1%: highly functional classes that have many different options, that aim for “reasonable” or “intelligent” defaults and behaviors, that allow users to override those defaults at any time, and yet that aim for a simple, unobtrusive API.
In those cases, Python’s simpler built-in, inheritance-based model leads to fairly complex code as non-trivial options and argument-management code spreads through many individual methods. This is where options’s delegation-based approach begins to shine.
For more backstory, see this StackOverflow.com discussion of how to combat “configuration sprawl”. options full documentation can be found at Read the Docs. For examples of options in use, see say and show.
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size options-1.0.6.tar.gz (145.0 kB)||File type Source||Python version None||Upload date||Hashes View|
|Filename, size options-1.0.6.zip (159.5 kB)||File type Source||Python version None||Upload date||Hashes View|