Author tomek.hlawiczka
Recipients tomek.hlawiczka
Date 2020-11-14.11:36:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1605353806.22.0.174145034354.issue42356@roundup.psfhosted.org>
In-reply-to
Content
With Python3.9 there is a great feature for merging `dict`s:
{1: 'a'} | {2: 'b'} => {1: 'a', 2: 'b'}


It would be very handy to filter out a dict with a similar fashion (for example & operator with a list/tuple/frozenset of keys you want to get back):
{1: 'a', 2: 'b', 3: 'c'} & [1, 3, 4] == {1: 'a', 3: 'c'}
{1: 'a', 2: 'b', 3: 'c'} & {1, 3, 4} == {1: 'a', 3: 'c'}


Also, omitting specified keys (for example - operator with a list/tuple/frozenset of keys you want to suppress):
{1: 'a', 2: 'b', 3: 'c'} - [3, 4] == {1: 'a', 2: 'b'}
{1: 'a', 2: 'b', 3: 'c'} - {3, 4} == {1: 'a', 2: 'b'}


Regards!
History
Date User Action Args
2020-11-14 11:36:46tomek.hlawiczkasetrecipients: + tomek.hlawiczka
2020-11-14 11:36:46tomek.hlawiczkasetmessageid: <1605353806.22.0.174145034354.issue42356@roundup.psfhosted.org>
2020-11-14 11:36:46tomek.hlawiczkalinkissue42356 messages
2020-11-14 11:36:46tomek.hlawiczkacreate