teaforthecat teaforthecat - 1 year ago 147
Python Question

Converting Python dict to kwargs?

I want to build a query for sunburnt(solr interface) using class inheritance and therefore adding key - value pairs together. The sunburnt interface takes keyword arguments. How can I transform a dict

into keyword arguments

Answer Source

Use the double-star (aka double-splat?) operator:


is equivalent to