Skip to content

Commit f7c92ed

Browse files
committed
allow slice e.g. system[2:5]
1 parent b931cd0 commit f7c92ed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dpdata/system.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def __str__(self):
162162

163163
def __getitem__(self, key):
164164
"""Returns proerty stored in System by key or by idx"""
165-
if isinstance(key, int):
165+
if isinstance(key, (int, slice)):
166166
return self.sub_system(key)
167167
return self.data[key]
168168

0 commit comments

Comments
 (0)