Updated the code up to just before the final "assembling" call (where the various pieces of the output formatted string are combined as specified by the options).
More consistent comment spacing.
More appropriate regexp group name.
Done (but not tested): main AffineScalarFunc.__format__() function.
To be done: _format_num() final format assembling function.
Docstring of the final format assembling function written.
Less wasteful call, when the shorthand format is used.