list of dictionaries search using kwargs

Larry Martell larry.martell at gmail.com
Mon Dec 7 17:33:06 EST 2020


On Mon, Dec 7, 2020 at 5:29 PM Marco Sulla <Marco.Sulla.Python at gmail.com> wrote:
>
> You can return dictionaries that returns True if
>
> (a.items() & kwargs.items()) == kwargs.items()
>
> when `a` is one of your dicts.

But what is passed in kwargs will not necessarily have values for all
of the keys and I only want to check for matches with the ones passed
in.


More information about the Python-list mailing list