Add __slots__ to internal printer class

This slightly reduces memory usage.
This commit is contained in:
Jeremy Saklad 2021-09-18 19:09:13 -05:00
parent 97aedc0895
commit 807c3d834c
Signed by: Jeremy Saklad
GPG Key ID: 9CA2149583EDBF84
1 changed files with 2 additions and 0 deletions

View File

@ -1392,6 +1392,8 @@ def Solve(shadowy_level, bone_market_fluctuations = None, zoological_mania = Non
class SkeletonPrinter(cp_model.CpSolverSolutionCallback): class SkeletonPrinter(cp_model.CpSolverSolutionCallback):
"""A class that prints the steps that comprise a skeleton as well as relevant attributes.""" """A class that prints the steps that comprise a skeleton as well as relevant attributes."""
__slots__ = 'this', '__solution_count'
def __init__(self): def __init__(self):
cp_model.CpSolverSolutionCallback.__init__(self) cp_model.CpSolverSolutionCallback.__init__(self)
self.__solution_count = 0 self.__solution_count = 0