Skip to content

Commit

Permalink
remove one more match/case
Browse files Browse the repository at this point in the history
  • Loading branch information
nornagon committed Mar 19, 2024
1 parent 87f077f commit 86e9040
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/automerge/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,10 @@ def __getitem__(self, key: str | int) -> MutableProxyThing:
if x is None: return None
value, obj_id = x
if isinstance(value, core.ObjType):
match value:
case core.ObjType.Map:
return MapWriteProxy(self._tx, obj_id, self._heads)
case core.ObjType.List:
return ListWriteProxy(self._tx, obj_id, self._heads)
if value == core.ObjType.Map:
return MapWriteProxy(self._tx, obj_id, self._heads)
elif value == core.ObjType.List:
return ListWriteProxy(self._tx, obj_id, self._heads)
raise Exception("unknown ObjType")
_, v = value
return v
Expand Down

0 comments on commit 86e9040

Please sign in to comment.