Page MenuHomePhabricator

upgrade: Use `improvement` subclasses everywhere, not instances

Authored by SimonSapin on May 25 2021, 2:11 AM.



This changes the source definition of optimizations to match that of formats:
a subclass with a decorator, instead of an instance passed to a function call.
Not having any instance removes the confusion between class attributes and
instance attributes, which were used interchangeably.

Diff Detail

rHG Mercurial
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

SimonSapin created this revision.May 25 2021, 2:11 AM
marmoute requested changes to this revision.May 25 2021, 4:35 AM
marmoute added a subscriber: marmoute.
marmoute added inline comments.

Why are dropping these comment? it seems useful.

This revision now requires changes to proceed.May 25 2021, 4:35 AM
SimonSapin added inline comments.May 26 2021, 5:14 AM

This docstring used to document instance attributes, but instances attributes aren’t used anymore. Class attributes already have individual comments in the base class definition with mostly the same content.

I had missed that touches_* class attributes were not documented individually, I’ll restore that (even though these comments are not doing much besides paraphrasing what the attribute names are already saying).

marmoute added inline comments.May 26 2021, 5:15 AM

okay, thanks for the explanation.

SimonSapin updated this revision to Diff 28204.May 26 2021, 5:16 AM
This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.