lang-model/naive-nlu/tree_nlu/modifiable_property.py

17 lines
752 B
Python
Raw Normal View History

import collections
ModifiableProperty = collections.namedtuple('ModifiableProperty',
['getter', 'setter'])
ModifiablePropertyWithAst = collections.namedtuple('ModifiablePropertyWithAst',
[
'getter',
'setter',
'ast',
'elements',
])
def is_modifiable_property(element):
return (isinstance(element, ModifiableProperty) or
isinstance(element, ModifiablePropertyWithAst))