On Fri, Apr 12, 2019 at 11:10 AM Viktor Roytman
wrote:
>
> The standard approach I have encountered in this scenario is to pass in
> the keyword arguments explicitly like so
>
> func(
> a=kwargs_dict["a"],
> b=kwargs_dict["b"],
> c=kwargs_dict["c"],
> )
>
func(**
On Sat, Apr 13, 2019 at 11:00 PM Juancarlo Añez wrote:
> func(**{k:v for k, v in d.items() if k in ('a','b','c'))
>
Would be really nice to be able to spell this as a dict/set intersection.
func(**(d & {'a', 'b', 'c'}))
ChrisA
___
Python-ideas mailing
On Saturday, April 13, 2019 at 9:03:54 AM UTC-4, Chris Angelico wrote:
>
> On Sat, Apr 13, 2019 at 11:00 PM Juancarlo Añez > wrote:
> > func(**{k:v for k, v in d.items() if k in ('a','b','c'))
> >
>
> Would be really nice to be able to spell this as a dict/set intersection.
>
> func(**(d & {'a', '
On Sat, Apr 13, 2019 at 9:02 AM Chris Angelico wrote:
> Would be really nice to be able to spell this as a dict/set intersection.
>
> func(**(d & {'a', 'b', 'c'}))
>
That would be _very_ consistent with the ongoing discussions about
operators over dicts.
--
Juancarlo *Añez*
___
On Sun, Apr 14, 2019 at 10:15 AM Juancarlo Añez wrote:
>
>
>
> On Sat, Apr 13, 2019 at 9:02 AM Chris Angelico wrote:
>>
>> Would be really nice to be able to spell this as a dict/set intersection.
>>
>> func(**(d & {'a', 'b', 'c'}))
>
>
> That would be _very_ consistent with the ongoing discussio