Skip to content

Commit 8973a48

Browse files
authored
Merge pull request #83 from njzjz/patch-2
allow slice e.g. system[2:5]
2 parents b931cd0 + f7c92ed commit 8973a48

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)