From a3a83aba0d06fd1640781ff37f5a09dabb6f40e5 Mon Sep 17 00:00:00 2001 From: Zane Bitter Date: Mon, 19 Feb 2018 17:40:13 -0500 Subject: [PATCH] Use __slots__ for more yaqltypes The change e693e6ecef9c331d4567c6708803e0d9cff1c15a added slots to the concrete classes in yaqltypes, however the abstract parent classes HiddenParameterType and LazyParameterType were omitted, with the result that their derived types would still contain an __dict__ attribute. Change-Id: I8e7335ced58b06cfd0de81ceb721dc2f8396f85f --- yaql/language/yaqltypes.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/yaql/language/yaqltypes.py b/yaql/language/yaqltypes.py index fdc9322..c276957 100644 --- a/yaql/language/yaqltypes.py +++ b/yaql/language/yaqltypes.py @@ -27,6 +27,8 @@ from yaql import yaql_interface @six.add_metaclass(abc.ABCMeta) class HiddenParameterType(object): + __slots__ = tuple() + # noinspection PyMethodMayBeStatic,PyUnusedLocal def check(self, value, context, engine, *args, **kwargs): return True @@ -34,7 +36,7 @@ class HiddenParameterType(object): @six.add_metaclass(abc.ABCMeta) class LazyParameterType(object): - pass + __slots__ = tuple() @six.add_metaclass(abc.ABCMeta) @@ -234,7 +236,7 @@ class Number(PythonType): class Lambda(LazyParameterType, SmartType): - __slots__ = tuple() + __slots__ = ('with_context', 'method') def __init__(self, with_context=False, method=False): super(Lambda, self).__init__(True) @@ -454,7 +456,7 @@ class Constant(SmartType): class YaqlExpression(LazyParameterType, SmartType): - __slots__ = ('_expression_type',) + __slots__ = ('_expression_types',) def __init__(self, expression_type=None): super(YaqlExpression, self).__init__(False)