Make use of yield in __iter__

This commit is contained in:
2023-03-15 03:33:24 +01:00
parent 73eaa0e89b
commit 404f71dddd
2 changed files with 3 additions and 10 deletions

View File

@@ -181,7 +181,7 @@ def test_add(
])
def test_iter(init_values: List[Union[bool, List[bool], bytes, str, Bitstream]]):
bitstream = Bitstream(*init_values)
assert len(iter(bitstream)) == len(bitstream)
assert len(list(bitstream)) == len(bitstream)
for index, bit in enumerate(bitstream):
assert bit == bitstream[index]