We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 75445f5 commit 24ab9c4Copy full SHA for 24ab9c4
src/celpy/celtypes.py
@@ -442,6 +442,9 @@ def __new__(
442
def __repr__(self) -> str:
443
return f"{self.__class__.__name__}({super().__repr__()})"
444
445
+ def contains(self, item: Value) -> BoolType:
446
+ return BoolType(cast(BytesType, item) in self)
447
+
448
449
class DoubleType(float):
450
"""
tests/test_celtypes.py
@@ -81,6 +81,7 @@ def test_bytes_type():
81
assert repr(b_0) == "BytesType(b'bytes')"
82
assert BytesType(None) == BytesType(b'')
83
assert BytesType(MessageType({"value": BytesType(b'42')})) == BytesType(b'42')
84
+ assert b_0.contains(b'byte')
85
86
87
def test_double_type():
0 commit comments