list of dictionaries search using kwargs

Marco Sulla Marco.Sulla.Python at gmail.com
Mon Dec 7 18:19:15 EST 2020


On Mon, 7 Dec 2020 at 23:35, Larry Martell <larry.martell at gmail.com> wrote:
>
> 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

That's why I used the operator `&`. Anyway you already made your choice :-)


More information about the Python-list mailing list