Skip to content

Commit a4a87c4

Browse files
Fix cast and test
1 parent b6062e8 commit a4a87c4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/celpy/celtypes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ def __repr__(self) -> str:
443443
return f"{self.__class__.__name__}({super().__repr__()})"
444444

445445
def contains(self, item: Value) -> BoolType:
446-
return BoolType(cast(StringType, item) in self)
446+
return BoolType(cast(BytesType, item) in self)
447447

448448

449449
class DoubleType(float):

tests/test_celtypes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def test_bytes_type():
8181
assert repr(b_0) == "BytesType(b'bytes')"
8282
assert BytesType(None) == BytesType(b'')
8383
assert BytesType(MessageType({"value": BytesType(b'42')})) == BytesType(b'42')
84-
assert b_0.contains("byte")
84+
assert b_0.contains(b"byte")
8585

8686

8787
def test_double_type():

0 commit comments

Comments
 (0)