In Classes and objects§
See primary documentation in context for TWEAK.
After bless
has initialized the classes attributes from the passed values, it will in turn call TWEAK
for each class in the inheritance hierarchy. TWEAK
gets passed all the arguments passed to bless. This is where custom initialization logic should go.
Remember to always make TWEAK
a submethod and not a normal method
. If in a class hierarchy a class contains a TWEAK
method (declared as a method
instead of a submethod
) that method is inherited to its subclass and will thus be called twice during construction of the subclass!