fix (slicing SectionItems)
@@ -242,12 +242,14 @@ class SectionItems(list):
'''Item-style access by either mnemonic or index.
Arguments:
- key (str, int): either a mnemonic or the index to the list.
+ key (str, int, slice): either a mnemonic or the index to the list.
Returns:
item from the list (either HeaderItem or CurveItem)
'''
+ if isinstance(key, slice):
+ return SectionItems(super(SectionItems, self).__getitem__(key))
for item in self:
if item.mnemonic == key:
return item
