From fcad35e8be449177fdd3d0f7c8f4f3c7a776b9d3 Mon Sep 17 00:00:00 2001 From: Ignace Bleukx Date: Thu, 18 Jun 2026 18:28:56 +0200 Subject: [PATCH] slots in numvarimpl --- cpmpy/expressions/variables.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cpmpy/expressions/variables.py b/cpmpy/expressions/variables.py index 80c93b36e..de4639cae 100644 --- a/cpmpy/expressions/variables.py +++ b/cpmpy/expressions/variables.py @@ -320,6 +320,8 @@ class _NumVarImpl(Expression): including bounds checking and value management. It should not be instantiated directly, but rather through the helper functions :func:`~cpmpy.expressions.variables.intvar` and :func:`~cpmpy.expressions.variables.boolvar`. """ + __slots__ = ('lb', 'ub', 'name', '_value') + def __init__(self, lb: int, ub: int, name: str): assert (is_num(lb) and is_num(ub)) assert (lb <= ub) @@ -432,6 +434,8 @@ class NegBoolView(_BoolVarImpl): Do not create this object directly, use the `~` operator instead: `~bv` """ + __slots__ = ('_bv',) + def __init__(self, bv: _BoolVarImpl): #assert(isinstance(bv, _BoolVarImpl)) self._bv = bv