Skip to content

Commit

Permalink
Merge pull request #1786 from actonlang/abe-dict-copy
Browse files Browse the repository at this point in the history
AbE: explain how to copy a dict
  • Loading branch information
plajjan authored Apr 13, 2024
2 parents 4916a26 + b887b18 commit 1923dfe
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 1923dfe

Please sign in to comment.