Closed sobolevn closed 2 years ago
The result of __contains__ is casted to bool.
__contains__
bool
Examples:
>>> class A: ... def __contains__(self, other): ... return other ... >>> 'abc' in A() True >>> None in A() False
So, technically -> bool is not correct 🤔
-> bool
And technically __len__ can return int | SupportsIndex. I think within the scope of this project, returning bool is fine because that's what __contains__ is supposed to return.
__len__
int | SupportsIndex
The result of
__contains__
is casted tobool
.Examples:
So, technically
-> bool
is not correct 🤔