sync with Atlas repo

This commit is contained in:
Luciano Ramalho
2014-11-19 17:10:02 -02:00
parent b3e36a2a41
commit 2f495627fb
12 changed files with 183 additions and 112 deletions

View File

@@ -42,7 +42,6 @@ Tests for update using a `dict` or a sequence of pairs::
# BEGIN STRKEYDICT
import collections
import collections.abc
class StrKeyDict(collections.UserDict): # <1>
@@ -58,15 +57,4 @@ class StrKeyDict(collections.UserDict): # <1>
def __setitem__(self, key, item):
self.data[str(key)] = item # <4>
def update(self, iterable=None, **kwds):
if iterable is not None:
if isinstance(iterable, collections.abc.Mapping): # <5>
pairs = iterable.items()
else:
pairs = ((k, v) for k, v in iterable) # <6>
for key, value in pairs:
self[key] = value # <7>
if kwds:
self.update(kwds) # <8>
# END STRKEYDICT