r/pythontips • • Mar 25 '19

Python *args and **kwargs explained with multiple examples (video)

Python *args and **kwargs explained with multiple examples

https://youtu.be/gYym32dMlUw

Enjoy!

44 Upvotes

6 comments sorted by

1

u/omnifected Mar 26 '19

kwargs.... Makes me scream everytime

2

u/kumonmehtitis Mar 26 '19

why? seems pretty straight forward

3

u/omnifected Mar 26 '19

It's very useful! I use it on my own sometimes when its needed but I've dealt with someone who always use kwargs. Even for mandatory arguments in a method... Kwargs are good but please, PLEASE use docstrings to explain their meanings!

1

u/Moondra2017 Mar 27 '19

I have used *args, but I have not really used **kwargs (except for decorators).
However, I have seen it used a lot in Python packages such as Keras etc.

1

u/Vabaluba Mar 26 '19

RemindMe! 5 hours

1

u/RemindMeBot Mar 26 '19

I will be messaging you on 2019-03-26 18:44:04 UTC to remind you of this link.

CLICK THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.


FAQsCustomYour RemindersFeedbackCodeBrowser Extensions