Skip to content

Use a named tuple class for (weight,immediate); no functional change

MVernon requested to merge namedtuples into main

Make the WeightChange class, which is a collections.namedtuple. This lets us access the weight and immediate members by name, making the code clearer.

It also reduces some confusion in the previous code where (immediate[,weight]) was used for overrides and (weight,immediate) was used for desired weight changes (i.e. after applying those overrides).

This change has been tested against the test suite on both python2 and python3.

Merge request reports