by ghc · 13y ago · 0 comments
If you are making functions that modify other functions (like decorators), these are highly useful. In Python you can't guarantee that all functions you will want to modify are going to have the same type signature, so you need to be able to gracefully handle all possible combinations and pass them on to your function body. Sometimes you'll just pass args and kwargs on to a wrapped function...other times you'll do things like pick out a single argument from kwargs and use it to do something useful. But make no mistake, in Python these come in handy to have!