Skip to content

Commit

Permalink
AbE: explain how to copy a dict
Browse files Browse the repository at this point in the history
  • Loading branch information
Kristian Larsson committed Apr 12, 2024
1 parent fd0e253 commit b887b18
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/acton-by-example/src/primitives/dicts.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ actor main(env):
print("Pop last item:", d.popitem())
print("Dict after .popitem():", d)

# Get a shallow copy of a dict. Note the use of .items() to get keys and values
new_d = dict(d.items())

env.exit(0)
```

Expand Down

0 comments on commit b887b18

Please sign in to comment.