Merge "Use __slots__ for more yaqltypes"

This commit is contained in:
Zuul 2018-12-25 08:41:24 +00:00 committed by Gerrit Code Review
commit 5a727ea9de
1 changed files with 5 additions and 3 deletions

View File

@ -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)