Open verhovsky opened 3 years ago
As https://www.python.org/dev/peps/pep-0584/#dict-d1-d2 points out,
[dict(d1, **d2)] only works when d2 is entirely string-keyed >>> d1 = {"spam": 1} >>> d2 = {3665: 2} >>> dict(d1, **d2) Traceback (most recent call last): ... TypeError: keywords must be strings
[dict(d1, **d2)] only works when d2 is entirely string-keyed
dict(d1, **d2)
>>> d1 = {"spam": 1} >>> d2 = {3665: 2} >>> dict(d1, **d2) Traceback (most recent call last): ... TypeError: keywords must be strings
So, when rewriting self.assertDictContainsSubset(a, b) as assert dict(b, **a) == b, we're introducing a test error if the dict can contain non-string keys.
self.assertDictContainsSubset(a, b)
assert dict(b, **a) == b
As https://www.python.org/dev/peps/pep-0584/#dict-d1-d2 points out,
So, when rewriting
self.assertDictContainsSubset(a, b)
asassert dict(b, **a) == b
, we're introducing a test error if the dict can contain non-string keys.