The PEP should probably also propose d1-d2.
>

What would be the output of this? Does this return a new dictionary where
keys in d2 are removed in d1 like sets?

>>> d = dict((i, i) for i in range(5))
>>> e = dict((i, i) for i in range(4, 10))
>>> d
{0: 0, 1: 1, 2: 2, 3: 3, 4: 4}
>>> e
{4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9}
>>> d.items() - e.items()
{(0, 0), (1, 1), (3, 3), (2, 2)}
>>> dict(d.items() - e.items())
{0: 0, 1: 1, 3: 3, 2: 2}

-- 
Regards,
Karthikeyan S
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to