From 35611f4cd869383678104dc94f82aa636c20eb24 Mon Sep 17 00:00:00 2001 From: Marco Sulla Date: Thu, 3 Feb 2022 23:21:59 +0100 Subject: [PATCH] Added examples --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 9a8ce25..1dd2963 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,21 @@ fd5 id(fd5) != id_fd5 # True +fd.set(1, 2) +# frozendict.frozendict({'Sulla': 'Marco', 'Hicks': 'Bill', 1: 2}) + +fd.set("Sulla", "Giulia") +# frozendict.frozendict({'Sulla': 'Giulia', 'Hicks': 'Bill'}) + +fd.delete("Sulla") +# frozendict.frozendict({'Hicks': 'Bill'}) + +fd.setdefault("Sulla", "Giulia") +# frozendict.frozendict({'Sulla': 'Marco', 'Hicks': 'Bill'}) + +fd.setdefault(1, 2) +# frozendict.frozendict({'Sulla': 'Marco', 'Hicks': 'Bill', 1: 2}) + fd2 = fd.copy() fd2 == fd # True