From 5c40daaf1cb25895c44a06e733456af77ab75f73 Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Tue, 24 Mar 2015 18:32:58 +0000 Subject: [PATCH] ImmutableMap.update --- letsencrypt/acme/jose/util.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/letsencrypt/acme/jose/util.py b/letsencrypt/acme/jose/util.py index 5f516884f..e8d2a17a6 100644 --- a/letsencrypt/acme/jose/util.py +++ b/letsencrypt/acme/jose/util.py @@ -57,6 +57,12 @@ class ImmutableMap(collections.Mapping, collections.Hashable): for slot in self.__slots__: object.__setattr__(self, slot, kwargs.pop(slot)) + def update(self, **kwargs): + """Return updated map.""" + items = dict(self) + items.update(kwargs) + return type(self)(**items) + def __getitem__(self, key): try: return getattr(self, key)