aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreterbase/baseobjects.py
diff options
context:
space:
mode:
authorDaniel Mensinger <daniel@mensinger-ka.de>2021-06-11 16:58:13 +0200
committerDaniel Mensinger <daniel@mensinger-ka.de>2021-06-18 23:48:33 +0200
commit63ade7d9378cae8ec2a811581684bf459407a7f0 (patch)
tree8cbc21520642db608b529f04d01fe25f89149ad3 /mesonbuild/interpreterbase/baseobjects.py
parent202e345dfba7ff3a39e4fb560b98889182dcc506 (diff)
downloadmeson-63ade7d9378cae8ec2a811581684bf459407a7f0.zip
meson-63ade7d9378cae8ec2a811581684bf459407a7f0.tar.gz
meson-63ade7d9378cae8ec2a811581684bf459407a7f0.tar.bz2
interpreter: Add a new MesonInterpreterObject for non-elementary objects
Diffstat (limited to 'mesonbuild/interpreterbase/baseobjects.py')
-rw-r--r--mesonbuild/interpreterbase/baseobjects.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/mesonbuild/interpreterbase/baseobjects.py b/mesonbuild/interpreterbase/baseobjects.py
index 3e3963f..511a146 100644
--- a/mesonbuild/interpreterbase/baseobjects.py
+++ b/mesonbuild/interpreterbase/baseobjects.py
@@ -51,12 +51,15 @@ class InterpreterObject:
return method(args, kwargs)
raise InvalidCode('Unknown method "%s" in object.' % method_name)
+class MesonInterpreterObject(InterpreterObject):
+ ''' All non-elementary objects should be derived from this '''
+
class MutableInterpreterObject:
''' Dummy class to mark the object type as mutable '''
TV_InterpreterObject = T.TypeVar('TV_InterpreterObject')
-class ObjectHolder(InterpreterObject, T.Generic[TV_InterpreterObject]):
+class ObjectHolder(MesonInterpreterObject, T.Generic[TV_InterpreterObject]):
def __init__(self, obj: TV_InterpreterObject, *, subproject: T.Optional[str] = None) -> None:
super().__init__(subproject=subproject)
self.held_object = obj
@@ -64,7 +67,7 @@ class ObjectHolder(InterpreterObject, T.Generic[TV_InterpreterObject]):
def __repr__(self) -> str:
return f'<Holder: {self.held_object!r}>'
-class RangeHolder(InterpreterObject):
+class RangeHolder(MesonInterpreterObject):
def __init__(self, start: int, stop: int, step: int, *, subproject: T.Optional[str] = None) -> None:
super().__init__(subproject=subproject)
self.range = range(start, stop, step)