Simplify ImmutableSequence.__bool__

This commit is contained in:
Dave Pearson
2023-01-05 23:06:42 +00:00
parent 7779211dcf
commit f9e00628ab

View File

@@ -42,7 +42,7 @@ class ImmutableSequence(Generic[T]):
return len(self)
def __bool__(self) -> bool:
return bool(len(self))
return bool(self._list)
def __contains__(self, item: T) -> bool:
return item in self._list