From b887b1882918a79ba20d1afcef4970830949b5ca Mon Sep 17 00:00:00 2001 From: Kristian Larsson Date: Fri, 12 Apr 2024 12:19:16 +0200 Subject: [PATCH] AbE: explain how to copy a dict --- docs/acton-by-example/src/primitives/dicts.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/acton-by-example/src/primitives/dicts.md b/docs/acton-by-example/src/primitives/dicts.md index c954c2cf1..69f76ee7c 100644 --- a/docs/acton-by-example/src/primitives/dicts.md +++ b/docs/acton-by-example/src/primitives/dicts.md @@ -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) ```