Added support for options in @spina, and prepare for new options.
Review Request #12904 — Created March 21, 2023 and submitted
This updates the
@spina
decorator to support the kinds of options
available to base classes. Subclasses can now set names and apply
mixins.A new
_prepareSubclass
handles the common functionality for the
mixins, and will soon handle new options as well for both base classes
and subclasses.To support passing in options to the decrator, the bulk of the logic
fromspinaSubclass
has been moved into an internal
_makeSpinaSubclass
function. The existingspinaSubclass
now chooses
how to call that and what to return based on whether or not options are
provided. If options are provided, a function is returned that itself
take in the decorated class. This works much like how Python decorators
do.We declare types for both variations of the decorator.
Tested this (along with upcoming changes) in Review Board, ensuring all
tests run.
Summary | ID |
---|---|
2d2a81f519d87df4b8486f09b7d15a607ed7a61c |