The 6 pillars#
The 6 pillars of izulu
all behavior is defined on the class-level
__template__class attribute defines the template for target error messagetemplate may contain “fields” for substitution from
kwargsand “defaults” to produce final error message
__toggles__class attribute defines constraints and behaviour (see “Toggles” section below)by default all constraints are enabled
“class hints” annotated with
ClassVarare noted byizuluannotated class attributes normally should have values (treated as “class defaults”)
“class defaults” can only be static
“class defaults” may be referred within
__template__
“instance hints” regularly annotated (not with
ClassVar) are noted byizuluall annotated attributes are treated as “instance attributes”
each “instance attribute” will automatically obtain value from the
kwargof the same name“instance attributes” with default are also treated as “instance defaults”
“instance defaults” may be static and dynamic
“instance defaults” may be referred within
__template__
kwargs— the new and main way to form exceptions/error instanceforget about creating exception instances from message strings
kwargsare the datasource for template “fields” and “instance attributes” (shared input for templating attribution)
Warning
Types from type hints are not validated or enforced!