Selfie
Loading...
Searching...
No Matches
selfie_lib.ArrayMap.ListBackedSet Class Reference
Inheritance diagram for selfie_lib.ArrayMap.ListBackedSet:
selfie_lib.ArrayMap.ArraySet selfie_lib.ArrayMap._ArrayMapEntries selfie_lib.ArrayMap._ArrayMapKeys

Public Member Functions

int __len__ (self)
 
Union[T, list[T]] __getitem__ (self, Union[int, slice] index)
 
Iterator[T__iter__ (self)
 
bool __contains__ (self, Any item)
 

Protected Member Functions

int _binary_search (self, Any item)
 

Detailed Description

Definition at line 42 of file ArrayMap.py.

Member Function Documentation

◆ __contains__()

bool selfie_lib.ArrayMap.ListBackedSet.__contains__ (   self,
Any  item 
)

Definition at line 52 of file ArrayMap.py.

52 def __contains__(self, item: Any) -> bool:
53 return self._binary_search(item) >= 0
54

◆ __getitem__()

Union[T, list[T]] selfie_lib.ArrayMap.ListBackedSet.__getitem__ (   self,
Union[int, slice]  index 
)

Reimplemented in selfie_lib.ArrayMap.ArraySet, selfie_lib.ArrayMap._ArrayMapKeys, and selfie_lib.ArrayMap._ArrayMapEntries.

Definition at line 47 of file ArrayMap.py.

47 def __getitem__(self, index: Union[int, slice]) -> Union[T, list[T]]: ...
48

◆ __iter__()

Iterator[T] selfie_lib.ArrayMap.ListBackedSet.__iter__ (   self)

Reimplemented in selfie_lib.ArrayMap.ArraySet, selfie_lib.ArrayMap._ArrayMapKeys, and selfie_lib.ArrayMap._ArrayMapEntries.

Definition at line 50 of file ArrayMap.py.

50 def __iter__(self) -> Iterator[T]: ...
51

◆ __len__()

int selfie_lib.ArrayMap.ListBackedSet.__len__ (   self)

Reimplemented in selfie_lib.ArrayMap.ArraySet, selfie_lib.ArrayMap._ArrayMapKeys, and selfie_lib.ArrayMap._ArrayMapEntries.

Definition at line 44 of file ArrayMap.py.

44 def __len__(self) -> int: ...
45

◆ _binary_search()

int selfie_lib.ArrayMap.ListBackedSet._binary_search (   self,
Any  item 
)
protected

Definition at line 55 of file ArrayMap.py.

55 def _binary_search(self, item: Any) -> int:
56 return _binary_search(self, item)
57
58

The documentation for this class was generated from the following file: