Fix getting individual items from KeySequence
This commit is contained in:
parent
9f0e1a98a0
commit
e9d58dae2a
@ -324,8 +324,12 @@ class KeySequence:
|
||||
return sum(len(seq) for seq in self._sequences)
|
||||
|
||||
def __getitem__(self, item):
|
||||
keys = list(self._iter_keys())
|
||||
return self.__class__(*keys[item])
|
||||
if isinstance(item, slice):
|
||||
keys = list(self._iter_keys())
|
||||
return self.__class__(*keys[item])
|
||||
else:
|
||||
infos = list(self)
|
||||
return infos[item]
|
||||
|
||||
def _iter_keys(self):
|
||||
return itertools.chain.from_iterable(self._sequences)
|
||||
|
Loading…
Reference in New Issue
Block a user