projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
bt2: add `StringValue.__contains__()` method
[babeltrace.git]
/
src
/
bindings
/
python
/
bt2
/
bt2
/
value.py
diff --git
a/src/bindings/python/bt2/bt2/value.py
b/src/bindings/python/bt2/bt2/value.py
index 8c8ef60c3de1a74bca8af47eb72ba203f5428c21..3acabe7998ca5eddd6fb788b20c93216c39ff9a1 100644
(file)
--- a/
src/bindings/python/bt2/bt2/value.py
+++ b/
src/bindings/python/bt2/bt2/value.py
@@
-404,6
+404,9
@@
class StringValue(collections.abc.Sequence, _Value):
def __len__(self):
return len(self._value)
+ def __contains__(self, item):
+ return self._value_to_str(item) in self._value
+
def __iadd__(self, value):
curvalue = self._value
curvalue += self._value_to_str(value)
This page took
0.02368 seconds
and
4
git commands to generate.