From: Vivien Maisonneuve Date: Fri, 20 Jun 2014 06:05:33 +0000 (+0200) Subject: Add __slots__ declarations X-Git-Tag: 1.0~226 X-Git-Url: https://svn.cri.ensmp.fr/git/linpy.git/commitdiff_plain/2a56c56cadd9be4dd461218b1620d2617ca8a924?ds=inline;hp=4a5b05e6a8198c51980c14101b06a3e9e0159f4c Add __slots__ declarations --- diff --git a/pypol/isl.py b/pypol/isl.py index ecc32c7..edfed5a 100644 --- a/pypol/isl.py +++ b/pypol/isl.py @@ -11,7 +11,9 @@ libisl.isl_dim_set = _isl.isl_dim_set class IslObject: - __slots__ = ('_ptr') + __slots__ = ( + '_ptr' + ) def __init__(self, ptr): self._ptr = ptr diff --git a/pypol/linear.py b/pypol/linear.py index 0712e1e..524b3cb 100644 --- a/pypol/linear.py +++ b/pypol/linear.py @@ -50,6 +50,13 @@ class Expression: This class implements linear expressions. """ + __slots__ = ( + '_coefficients', + '_constant', + '_symbols', + '_dimension' + ) + def __new__(cls, coefficients=None, constant=0): if isinstance(coefficients, str): if constant: @@ -410,6 +417,13 @@ class Polyhedron: This class implements polyhedrons. """ + __slots__ = ( + '_equalities', + '_inequalities', + '_constraints', + '_symbols' + ) + def __new__(cls, equalities=None, inequalities=None): if isinstance(equalities, str): if inequalities is not None: