Skip to content

Commit 17cc434

Browse files
committed
Add support for TYPE_SLICE
1 parent 683958f commit 17cc434

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

marshalparser/marshalparser.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,12 @@ def read_object(self) -> Any:
166166
elif type == "TYPE_FROZENSET":
167167
result = frozenset(result)
168168

169+
elif type == "TYPE_SLICE":
170+
start = self.read_object()
171+
stop = self.read_object()
172+
step = self.read_object()
173+
result = slice(start, stop, step)
174+
169175
elif type == "TYPE_NULL":
170176
result = "null"
171177

marshalparser/object_types.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
b"?": "TYPE_UNKNOWN",
2424
b"<": "TYPE_SET",
2525
b">": "TYPE_FROZENSET",
26+
b":": "TYPE_SLICE",
2627
b"a": "TYPE_ASCII",
2728
b"A": "TYPE_ASCII_INTERNED",
2829
b")": "TYPE_SMALL_TUPLE",

0 commit comments

Comments
 (0)