How to pass a dict when a Python function expects **kwargs

preview_player
Показать описание
Many Python functions have a **kwargs parameter — a dict whose keys and values are populated via keyword arguments. But what if you have a dict, and want to turn it into keyword arguments? In this video, I explain the use of ** when you're calling a function, and how it's different from passing a dict.

Рекомендации по теме
Комментарии
Автор

Thank you, It just what l'm looking for.

athipudr
Автор

So, this would be the pythonic equivalent to the spread operator in JS -- correct?
Thanks for sharing!

ruideklerk
Автор

This is similar to function calls with list unpacking

aflous
welcome to shbcf.ru